Conversation
TheLostLambda
approved these changes
Sep 30, 2020
Collaborator
TheLostLambda
left a comment
There was a problem hiding this comment.
Aside from a potentially stray comment, this looks excellent! A nice feature to have!
src/network/dns/resolver.rs
Outdated
| Some(dns_server_address) => { | ||
| let mut config = ResolverConfig::new(); | ||
| let options = ResolverOpts::default(); | ||
| // let socket = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(1, 1, 1, 1), 53)); |
Collaborator
There was a problem hiding this comment.
Should this comment be removed? Is it something that still needs addressing?
Owner
Author
There was a problem hiding this comment.
Hot damn, thanks for catching this :)
| tls_dns_name: None, | ||
| }; | ||
| config.add_name_server(nameserver_config); | ||
| TokioAsyncResolver::new(config, options, runtime).await? |
Collaborator
There was a problem hiding this comment.
It's a shame we can't just change the nameserver of the configuration returned by from_system_conf, but I think this is the best we can do right now :)
Owner
Author
There was a problem hiding this comment.
Yeah, for sure. I mostly want this feature as a workaround for issues where we fail to parse resolv.conf, so we'd be panicking by then.
Owner
Author
|
Thanks for the review @TheLostLambda ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since there are some cases in which we don't properly detect the system dns servers to performs reverse dns lookup, I added a CLI option that would allow users to manually specify a dns server as a workaround.
Usage example:
sudo bandwhich --dns-server 1.1.1.1