1

I have a LAN DNS set up so that I can access LAN hosts by an unqualified name. For the examples below, the domain is 'michigan' and the host is 'acer'.

Notice that I can ping acer but dig acer gets no answer. Only if I give dig the qualified name does dig get an answer.

stephen@home:~$ ping -c1 acer 
64 bytes from 192.168.0.110 (192.168.0.110): icmp_seq=1 ttl=64 time=1.13 ms

stephen@home:~$ dig acer | grep ANSWER:
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

stephen@home:~$ dig acer.michigan | grep ANSWER:
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

Is there an error in my configuration or is this expected behavior for dig?

2 Answers2

5

You figured out the solution yourself:

Only if I give dig the qualified name does dig get an answer.

dig doesn't automatically append your connection's DNS suffix(es) to its queries, unlike other tools. This is expected.

0

Something sounds messed up with your configuration. There shouldn't be a need to type in the domain name if you are on the same domain.

From man dig:

NAME
       dig - DNS lookup utility

DESCRIPTION
       dig (domain information groper) is a flexible tool for interrogating
       DNS name servers. It performs DNS lookups and displays the answers that
       are returned from the name server(s) that were queried. Most DNS
       administrators use dig to troubleshoot DNS problems because of its
       flexibility, ease of use and clarity of output. Other lookup tools tend
       to have less functionality than dig.

       Unless it is told to query a specific name server, dig will try each of
       the servers listed in /etc/resolv.conf. If no usable server addresses
       are found, dig will send the query to the local host.

I have searched the dig man page and I cannot find the word qualified anywhere in it.

Showing my network setup and examples:

terrance@terrance-ubuntu:~$ 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
nameserver 10.0.0.1
search local

terrance@terrance-ubuntu:~$ nslookup DD-WRT
Server:     10.0.0.1
Address:    10.0.0.1#53

Name:   DD-WRT.local
Address: 10.0.0.1

terrance@terrance-ubuntu:~$ dig DD-WRT

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

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;DD-WRT.                IN  A

;; ANSWER SECTION:
DD-WRT.         0   IN  A   10.0.0.1

;; Query time: 0 msec
;; SERVER: 10.0.0.1#53(10.0.0.1)
;; WHEN: Wed Apr 11 18:31:50 MDT 2018
;; MSG SIZE  rcvd: 51


terrance@terrance-ubuntu:~$ dig terrance-ubuntu

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

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;terrance-ubuntu.       IN  A

;; ANSWER SECTION:
terrance-ubuntu.    0   IN  A   10.0.0.100

;; Query time: 0 msec
;; SERVER: 10.0.0.1#53(10.0.0.1)
;; WHEN: Wed Apr 11 18:32:37 MDT 2018
;; MSG SIZE  rcvd: 60

My conclusion is something in your network setup is not correct.

Terrance
  • 43,712