1

I've something strange with DNS servers : I can't resolve url.

The /etc/resolv.conf file seems to be managed by NetworkManager and points to 127.0.0.53 (looks good so far):

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53

When I list the DNS server of the current connection with nmcli device connection wlp3s0 | grep DNS it shows me IP that contains DNS server that works, i.e. when I do dig google.com @IPNMCLI, I have a valid output (good so far):

$ nmcli device show wlp2s0 | grep IP4.DNS
IP4.DNS[1]:                             132.XX.XX.XX
IP4.DNS[2]:                             132.YY.YY.YY

$ dig google.com @132.YY.YY.YY

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> google.com @132.YY.YY.YY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37232
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 9

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     101 IN  A   172.217.18.206

;; AUTHORITY SECTION:
google.com.     19122   IN  NS  ns2.google.com.
[...]
;; Query time: 3 msec
;; SERVER: 132.YY.YY.YY#53(132.YY.YY.YY)
;; WHEN: Tue Jan 28 14:49:39 CET 2020
;; MSG SIZE  rcvd: 303

BUT, when I try to run dig google.com @127.0.0.53, a request is sent, but the answer has an error SERVFAIL:

dig google.com @127.0.0.53

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> google.com @127.0.0.53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 59952
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.            IN  A

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue Jan 28 14:26:37 CET 2020
;; MSG SIZE  rcvd: 39

Any idea what's wrong, and why NetworkManager's local DNS server is not working?

Thanks.

Plussoyeur
  • 111
  • 1
  • 2
  • Does this answer your question? [Why doesn't systemd-resolved use my local DNS server?](https://unix.stackexchange.com/questions/424799/why-doesnt-systemd-resolved-use-my-local-dns-server) –  Jan 28 '20 at 15:06
  • So the problem is solved but I did not do anything more (not even restarted network-manager and etcaetera which I already did). I really don't understand. Now /etc/resolv.conf features a new line which is the right DNS server. – Plussoyeur Jan 28 '20 at 16:24
  • nitpick: "I've something strange with DNS servers : I can't resolve url." the DNS does not resolve "URLs", but, in your case, names. That is an `A` record maps a name to a give IP address, and hence resolves it (and `AAAA` records do the same for IPv6 addresses). An URL is more than just an hostname. – Patrick Mevzek Jan 29 '20 at 23:46
  • "Any idea what's wrong, and why NetworkManager's local DNS server is not working?" did you look at your logfiles, and here in `journalctl` since `127.0.0.53` is default IP address for systemd DNS resolver? `SERVFAIL` is a pretty serious DNS error and a nameserver doing that is bound to log why it does so. – Patrick Mevzek Jan 29 '20 at 23:48
  • Thanks for the precision. I did had a look at `journalctl` yes. Now the problem is solved though. – Plussoyeur Jan 31 '20 at 09:13

0 Answers0