Add to Favourites Add to Favourites    Print this Article Print this Article

Testing your DNS IPs from /etc/resolv.conf

If you get DNS lookup errors, it might be invalid IPs set in the file:


The resolver will start at the first "nameserver" entry and work it's way down.

A sample /etc/resolv.conf might look like


You might have IPs specified listed by your datacenter, to use their nameservers.

To test the lookup the record of a domain: with a specific DNS IP: , set the values you want, and run the following:

dig A @

You might get output like this:

[root@es6-64 ~]# dig A @

; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> A @
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15679
;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 0

;                    IN      A

;; ANSWER SECTION:             207     IN      A

;; Query time: 34 msec
;; WHEN: Mon Sep 28 00:09:49 2015
;; MSG SIZE  rcvd: 284

Where the value you're looking for is the IP under the ;; ANSWER SECTION.

Was this answer helpful?

Also Read