I've been trying to figure out how to test this with dig instead, and I think I found something. If you have a normal /etc/resolv.conf then you see this:
===
$ dig -t soa local.; echo $?
; <<>> DiG 9.11.3-1ubuntu1.1-Ubuntu <<>> -t soa local.
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 2061
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;local. IN SOA
If, instead, you add "local" to the search then you get this:
===
$ dig -t soa local.; echo $?
; <<>> DiG 9.11.3-1ubuntu1.1-Ubuntu <<>> -t soa local.
;; global options: +cmd
;; connection timed out; no servers could be reached
9
===
This may not be a good test (maybe under some other configuration some sort of response is sent?), but it might be a good idea to figure out how to accomplish this without using host.
I've been trying to figure out how to test this with dig instead, and I think I found something. If you have a normal /etc/resolv.conf then you see this:
===
$ dig -t soa local.; echo $?
; <<>> DiG 9.11.3- 1ubuntu1. 1-Ubuntu <<>> -t soa local.
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 2061
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;local. IN SOA
;; Query time: 0 msec 53#53(127. 0.0.53)
;; SERVER: 127.0.0.
;; WHEN: Fri Aug 24 09:16:38 MDT 2018
;; MSG SIZE rcvd: 34
0
===
If, instead, you add "local" to the search then you get this:
===
$ dig -t soa local.; echo $?
; <<>> DiG 9.11.3- 1ubuntu1. 1-Ubuntu <<>> -t soa local.
;; global options: +cmd
;; connection timed out; no servers could be reached
9
===
This may not be a good test (maybe under some other configuration some sort of response is sent?), but it might be a good idea to figure out how to accomplish this without using host.