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

Setting invalid options in /etc/resolv.conf makes dns unresponsive #418

Open
aleksanderdidriksen opened this issue Dec 11, 2023 · 1 comment

Comments

@aleksanderdidriksen
Copy link

aleksanderdidriksen commented Dec 11, 2023

If you set invalid options in /etc/resolv.conf aardvark-dns will be unresponsive. It will run, but does not give any error even with RUST_LOG=trace

Note: these options are from Oracle Solaris and setting these options on a RHEL-based OS will not prevent DNS requests.

This is an example file: /etc/resolv.conf

search this.is.dumb dont.do.this unless.you.want your.queries.to.fail like.this
options retrans:3 retry:1
nameserver 8.8.8.8

aardvark-dns starts:

RUST_LOG=trace /usr/libexec/podman/aardvark-dns --config /run/containers/networks/custom-dns -p 4343 run

ps aux
root        6587  0.0  0.0 276552   220 ?        Ssl  17:25   0:00 /usr/libexec/podman/aardvark-dns --config /run/containers/networks/backup-dns -p 4343 run

However, it does not respond to any queries:

dig @127.0.0.1 -p 4343 google.com

; <<>> DiG 9.16.23-RH <<>> @127.0.0.1 -p 4343 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

No errors or anything about it found in syslog:

cat /var/log/messages | grep dns

But shows other logs from previous testing, for example:
aardvark-dns[5506]: Unable to start server unable to start CoreDns server: Cannot assign requested address (os error 99)
aardvark-dns[5758]: Unable to start server unable to start CoreDns server: Address already in use (os error 98)

If you remove the bogous options from the /etc/resolv.conf file it works again. E.g. with this /etc/resolv.conf it will respond to queries as expected:

search this.is.dumb dont.do.this unless.you.want your.queries.to.fail like.this
nameserver 8.8.8.8

Tested:
aardvark-dns 1.7.0 (Podman package RHEL-based)
aardvark-dns 1.9.0 (Github Releases)

@aleksanderdidriksen aleksanderdidriksen changed the title Setting invalid options on host in /etc/resolv.conf makes dns unresponsive Setting invalid options in /etc/resolv.conf makes dns unresponsive Dec 11, 2023
@baude
Copy link
Member

baude commented Dec 14, 2023

in some ways, a strong argument could be made that it is behaving as designed ... but it would be nice to be more graceful. @aleksanderdidriksen are you interested in creating a PR?

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

2 participants