From 230a308a651fd0c3611103794038e214df19ff25 Mon Sep 17 00:00:00 2001 From: Aaryamann Challani <43716372+rymnc@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:53:24 +0530 Subject: [PATCH] fix(dnsaddr_resolution): use fqdn separator to prevent suffixing by dns resolvers (#2222) ## Linked Issues/PRs - fixes https://github.com/FuelLabs/fuel-core/issues/2221 ## Description Some dns resolvers `nslookup` etc, suffix dns lookups with the local domain if they are not fully-qualified. This PR makes the dns lookup FQDN, with a dot at the end. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --- crates/services/p2p/src/dnsaddr_resolution.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/services/p2p/src/dnsaddr_resolution.rs b/crates/services/p2p/src/dnsaddr_resolution.rs index 8a6268a929e..0796a60c8d6 100644 --- a/crates/services/p2p/src/dnsaddr_resolution.rs +++ b/crates/services/p2p/src/dnsaddr_resolution.rs @@ -94,9 +94,9 @@ mod tests { ].iter().map(|s| s.parse().unwrap()).collect(); // when - // run a `dig +short txt _dnsaddr.core-test.fuellabs.net` to get the TXT records + // run a `dig +short txt _dnsaddr.core-test.fuellabs.net.` to get the TXT records let multiaddrs = resolver - .lookup_dnsaddr("core-test.fuellabs.net") + .lookup_dnsaddr("core-test.fuellabs.net.") .await .unwrap(); // then