Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make resolv.conf generation more deterministic #339

Merged
merged 1 commit into from
Oct 1, 2021

Conversation

fhunleth
Copy link
Member

@fhunleth fhunleth commented Oct 1, 2021

This sorts the resolv.conf entries such that global name servers always
come first and in the order that they're specified. After the global
name servers, try to follow the order that DHCP servers or static
configurations specify. There isn't an attempt to be perfect here since
you could come of with interfaces specifying opposing orders and it
probably wouldn't matter or be that common.

The importance of being more deterministic is that DNS queries go to the
servers in the order listed. If you specify a set of DNS servers to be
used globally, you probably expect them to be queried before anything
supplied by DHCP. Previously the server IP address had an effect on the
order due to the use of maps to collect servers. This led to a confusing
bug different behavior was observed in two different places that was
traced down to on subnet being a 10.x.x.x and the other being a
192.168.x.x and this changing the resolver order.

This sorts the resolv.conf entries such that global name servers always
come first and in the order that they're specified. After the global
name servers, try to follow the order that DHCP servers or static
configurations specify.  There isn't an attempt to be perfect here since
you could come of with interfaces specifying opposing orders and it
probably wouldn't matter or be that common.

The importance of being more deterministic is that DNS queries go to the
servers in the order listed. If you specify a set of DNS servers to be
used globally, you probably expect them to be queried before anything
supplied by DHCP. Previously the server IP address had an effect on the
order due to the use of maps to collect servers. This led to a confusing
bug different behavior was observed in two different places that was
traced down to on subnet being a 10.x.x.x and the other being a
192.168.x.x and this changing the resolver order.
@jjcarstens
Copy link
Member

This seems to be working on my 10.x.x.x network now.

The Node.ping/1 are sometimes taking seconds and result in a :pang, but it eventually connects 👇
image

Here is an attempt that was relatively quick to work 👇
image

I think the speed of the pings to connect are more a factor of my network, but thought I would mention incase you know more than me (which is almost always the case)

@fhunleth
Copy link
Member Author

fhunleth commented Oct 1, 2021

Thanks for verifying this.

I'm not sure why it's slow to resolve the .local names. I think I'd have to study some Wireshark traces to tell you something useful.

@fhunleth fhunleth merged commit 7071964 into main Oct 1, 2021
@fhunleth fhunleth deleted the deterministic-resolv-conf branch October 1, 2021 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants