I've installed pi-hole on my raspberry pi and used it as an ad-blocker for a while. I would like to also to benefit from it as a local DNS to use human-readable domains and not IP addresses, but I can't figure out what is wrong. I set up it via docker container with network_mode: "host", and added a DNS record in pi-hole gui (pi.local -> to 192.168.50.83 (IP of raspberry pi itself)), but still no effect
Expected Behaviour:
I can access pi not only via IP address, but also via domain name
Actual Behaviour:
In Google Chrome (macOS) I get DNS_PROBE_FINISHED_NXDOMAIN error while trying to navigate to http://pi.local/
The result of nslookup pi.local from my desktop is
; <<>> DiG 9.10.6 <<>> pi.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: NOERROR, id: 43131
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pi.local. IN A
;; ANSWER SECTION:
pi.local. 0 IN A 192.168.50.83
;; Query time: 2 msec
;; SERVER: 192.168.50.83#53(192.168.50.83)
;; WHEN: Sat May 14 12:52:24 IDT 2022
;; MSG SIZE rcvd: 53
; <<>> DiG 9.10.6 <<>> pi.hole
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39474
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pi.hole. IN A
;; ANSWER SECTION:
pi.hole. 0 IN A 0.0.0.0
;; Query time: 2 msec
;; SERVER: 192.168.50.83#53(192.168.50.83)
;; WHEN: Sat May 14 22:56:56 IDT 2022
;; MSG SIZE rcvd: 52
The result of ping pi.hole
PING pi.hole (0.0.0.0): 56 data bytes
ping: sendto: Socket is not connected
ping: sendto: Socket is not connected
Request timeout for icmp_seq 0
ping: sendto: Socket is not connected
Request timeout for icmp_seq 1
ping: sendto: Socket is not connected
Request timeout for icmp_seq 2
ping: sendto: Socket is not connected
Request timeout for icmp_seq 3
ping: sendto: Socket is not connected
Request timeout for icmp_seq 4
ping: sendto: Socket is not connected
Request timeout for icmp_seq 5
I meant to have you make a query for pi.hole on a client that used Pi-hole for DNS and then check the query log on the web interface to see what the log shows as the source of the answer.