0

I have an ubuntu 16.04 vm and it often fails to resolve DNS requests. As you can see I've set DNS servers:

➜  ~ nmcli device show ens33|grep IP4.DNS
IP4.DNS[1]:                             4.2.2.2
IP4.DNS[2]:                             8.8.8.8
IP4.DNS[3]:                             208.67.222.222

But nslookup fails to resolve the address:

➜  ~ nslookup 
> yahoo.com
;; connection timed out; no servers could be reached

The weird problem is where I set server on nslookup and it works:

> server 4.2.2.2
Default server: 4.2.2.2
Address: 4.2.2.2#53
> yahoo.com
Server:     4.2.2.2
Address:    4.2.2.2#53

Non-authoritative answer:
Name:   yahoo.com
Address: 206.190.36.45
Name:   yahoo.com
Address: 98.138.253.109
Name:   yahoo.com
Address: 98.139.183.24

I'm seeking some way to understand how things work and troubleshoot the problem.

PS: We use some VPN for internet connection in our company and everything was OK under same circumstances before.

*UPDATE: * dig output on the vm is:

➜  ~ dig

; <<>> DiG 9.10.3-P4-Ubuntu <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21749
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;.              IN  NS

;; ANSWER SECTION:
.           518400  IN  NS  a.root-servers.net.
.           518400  IN  NS  b.root-servers.net.
.           518400  IN  NS  c.root-servers.net.
.           518400  IN  NS  d.root-servers.net.
.           518400  IN  NS  e.root-servers.net.
.           518400  IN  NS  f.root-servers.net.
.           518400  IN  NS  g.root-servers.net.
.           518400  IN  NS  h.root-servers.net.
.           518400  IN  NS  i.root-servers.net.
.           518400  IN  NS  j.root-servers.net.
.           518400  IN  NS  k.root-servers.net.
.           518400  IN  NS  l.root-servers.net.
.           518400  IN  NS  m.root-servers.net.

;; Query time: 234 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Sun May 14 15:44:47 IRDT 2017
;; MSG SIZE  rcvd: 239
  • Do you have different networks with different DNS entries? What does digsay? – ridgy May 14 '17 at 11:10
  • @ridgy just added dig output to question. – Mehraban May 14 '17 at 11:16
  • Check if you have DNS Leak while connected to VPN. – Xaqron May 14 '17 at 11:22

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.