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

Failover to other DNS nameservers #228

Closed
drnic opened this issue Jun 23, 2014 · 4 comments
Closed

Failover to other DNS nameservers #228

drnic opened this issue Jun 23, 2014 · 4 comments

Comments

@drnic
Copy link
Contributor

drnic commented Jun 23, 2014

From what I was observing (v0.2.X), it seems that if I add consul agent as the first nameserver in /etc/resolv.conf and a hostname isn't resolved by consul, then it doesn't failover to the other nameservers [1] as other DNS nameservers have done for me in the past. Which chunk of consul code is doing this, and how should it fail nicely as a resolv nameserver if it cannot resolve a hostname (nor does its optional recursor chain)?

[1] I know consul also supports a single explicit recursor

@drnic
Copy link
Contributor Author

drnic commented Jun 23, 2014

I'm assuming that consul is the primary nameserver and it allows 0+ secondary nameservers. It doesn't seem to allow the secondaries a chance to resolve hostnames.

@salehe
Copy link

salehe commented Jun 23, 2014

@drnic AFAIK the behavior of linux resolver is to failover to next nameservers defined in /etc/resolv.conf only if the previous one is timed out. Once a nameserver responds to the query (either with failure or success), the resolver process is over.
In your case, if consul agent is available, secondary nameservers are always bypassed.

@armon
Copy link
Member

armon commented Jun 24, 2014

This is odd indeed, since we didn't change the way DNS works at all between 0.2 and 0.3. The only changes were to optionally allow for TTL values or stale reads. Default behavior is unchanged. I agree with @salehe however, that the secondaries are only used if the first DNS server fails to respond. Relying on that behavior for DNS recursion is not the way to go.

@armon
Copy link
Member

armon commented Jul 2, 2014

Closing, but please re-open if an issue.

@armon armon closed this as completed Jul 2, 2014
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

No branches or pull requests

3 participants