1

On my router, for my home network, in the DHCP server settings, I specified the primary and secondary DNS servers as 8.8.8.8, 8.8.4.4. I have Ubuntu 16.04.4 LTS installed on my home server. For network management I use NeteorkManager, with included dnsmasq. The /etc/resolv.conf file contains: nameserver 127.0.1.1

I noticed that, if I request a dns entry, then the Ubuntu sends two requests simultaneously to the primary and secondary dns server.

Send query:

nslookup ya.ru

Information from tcpdump:

19: 07: 53.596844 IP 192.168.100.14.38814> 8.8.8.8.53: 41973+ A? ya.ru. (23)
19: 07: 53.596853 IP 192.168.100.14.38814> 8.8.4.4.53: 41973+ A? ya.ru. (23)
19: 07: 53.600385 IP 8.8.8.8.53> 192.168.100.14.38814: 41973 1/0/0 A 87.250.250.242 (39)
19: 07: 53.615338 IP 8.8.4.4.53> 192.168.100.14.38814: 41973 1/0/0 A 87.250.250.242 (39)

Why does the system send two requests at once? And what do I need to change so that it would behave logically and send a request to the secondary DNS server only when there is no response from the Primary DNS server.

  • What's more important to you, time or packet count? If your DNS cache server process decided to ask all servers the question, and give you the first answer that comes back, (i.e. qucker ) is that so wrong? – infixed May 14 '18 at 16:29
  • @infixed, this behavior is determined in some settings? For example, on the server of CentOS 7 a repeated request is sent only in case the first fails. – Dmitriy May 14 '18 at 16:40
  • Note, I am just reading the man page of dnsmasq, not from personal experience. I do not run centos. There is a switch --all-servers that enables the behavior I speculated as happening. It could either be in the command line that launched the server, or in the config file. See the man page for details – infixed May 14 '18 at 21:07
  • @infixed, thanks for your comment, really interesting parameter, but dnsmasq running without specifying --all-servers: /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d /etc/NetworkManager/dnsmasq.d is empty – Dmitriy May 15 '18 at 7:52
  • I see evidence in google that dnsmasq can also be controlled via DBUS. And the options you list show a listen-dbus option. Perhaps there is a network manager of some sort invoking this option that way. I don't know if it will help, but this answer, askubuntu.com/a/853302/520070 , indicates you can get a dnsmasq process to dump status to the log files with a signal – infixed May 15 '18 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.