I've just set up a Debian 9 home server and I'm having weird DNS issues. I've googled around but no luck so far. I'm not a Unix newbie but I know almost nothing about networking on linux. All I know about the issue is every so often all my internet based commands return something along the lines of "Could not resolve host" some mention it being a temporary issue. Local networking is fine, although to start with I could connect using .local but now I have to use the IP address. The issue is only appearing on the Debian machine, other machines are working fine.

Sorry for not having much to go on, I have no clue where to start with this one.

[EDIT] running dig google.com gives this:

;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14883
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;google.com.                    IN      A

google.com.             75      IN      A

;; Query time: 16 msec
;; WHEN: Tue Sep 26 01:53:18 BST 2017
;; MSG SIZE  rcvd: 55

and running dig google.com @ gives this:

; <<>> DiG 9.10.3-P4-Debian <<>> google.com @
;; global options: +cmd
;; connection timed out; no servers could be reached

I re-ran both of these while the issues were happening and both commands gave the second result

I think I've also added as a nameserver, nmcli gives this:

DNS configuration:
  • If it's a DNS issue try changing the DNS server to the correct one or use Google's .
    – user772515
    Sep 26, 2017 at 0:13
  • Try using the nslookup, or better yet, dig commands to see if you can resolve the IP address in that way. Ideally you would check against the default resolver for the system like dig google.com and against a specific public DNS server like dig google.com @ Reporting the results back here will aid in answering your question. Sep 26, 2017 at 0:18
  • Updated question with more info Sep 26, 2017 at 1:00
  • You have both a local nameserver, probably from your router, and Google's nameserver (check /etc/resolv.conf to verify). One of those will be picked at random for each DNS lookup, and of one has trouble (could be either one, e.g. when Google NS access is filtered somewhere), every so often you'll have those failures. So (1) configure just one nameservers for (2) each of those in turn, and (3) see which is problematic, then (4) use the other one.
    – dirkt
    Sep 26, 2017 at 6:47
  • I've done that, seems that I need to use However now the nameserver in resolv.conf keeps getting reset to the bad one, how do I prevent this? Sep 26, 2017 at 17:03


You must log in to answer this question.

Browse other questions tagged .