Local DNS Records

Expected Behaviour:

Local Hostname resolution using Local DNS Records.

As I understand it, entries here will allow local hostname resolution, however it doesnt't seem to be working. Yes, I have used search but find only historical articles on /etc/hosts (which works). This is a new install of pihole. The hostnames are updated IN pihole dashboard, but pcs cannot ping with hostname or use hostnames, only IP

Actual Behaviour:

Only works when using /etc/hosts

Please post the token generated by

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

[✓] Your debug token is: https://tricorder.pi-hole.net/3oqapgsf9y

What is the output of

cat /etc/pihole/custom.list

192.168.1.4 TEG-448WS
192.168.1.5 coddc
192.168.1.6 server1
192.168.1.8 server
192.168.1.9 amelia
192.168.1.10 server-1
192.168.1.11 anthony
192.168.1.12 snipeit
192.168.1.13 coddc1
192.168.1.14 andrea
192.168.1.15 download
192.168.1.16 reddevil

and many more...

And the output of

dig -x coddc @192.168.1.37

Edit - this should have been:

dig -x 192.168.1.5 @192.168.1.37

dig -x coddc @192.168.1.37

; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> -x coddc @192.168.1.37
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 53972
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;coddc.in-addr.arpa.            IN      PTR

;; AUTHORITY SECTION:
in-addr.arpa.           3600    IN      SOA     b.in-addr-servers.arpa. nstld.iana.org. 2020072109 1800 900 604800 3600

;; Query time: 128 msec
;; SERVER: 192.168.1.37#53(192.168.1.37)
;; WHEN: Fri Jul 31 15:18:21 UTC 2020
;; MSG SIZE  rcvd: 127

Output of this:

dig coddc

dig coddc

; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> coddc
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 43250
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;coddc.                         IN      A

;; AUTHORITY SECTION:
.                       86400   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2020073100 1800 900 604800 86400

;; Query time: 21 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Fri Jul 31 15:35:18 UTC 2020
;; MSG SIZE  rcvd: 109

That went to Cloudflare. Let's force the query to Pi-hole:

dig coddc @192.168.1.37

dig coddc @192.168.1.37

; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> coddc @192.168.1.37
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50258
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
coddc.                  2       IN      A       192.168.1.5

;; Query time: 0 msec
;; SERVER: 192.168.1.37#53(192.168.1.37)
;; WHEN: Fri Jul 31 15:40:13 UTC 2020
;; MSG SIZE  rcvd: 50

That is the correct answer. Is this domain name also mapped in /etc/hosts?

In my config, I have

Never forward non-FQDNs
Never forward reverse lookups for private IP ranges
Use Conditional Forwarding

192.168.1.0/24 192.168.1.1 mydomain.com

no, my hosts file is defualt right now

Please comment out the hosts file entry (these take precedence) and restart FTL, then rerun the dig commands for that domain and IP.

cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 pihole


# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

my hosts file is at default state

Ok, after further experimenting, the custsom.list file wants a fqdn, ie coddc.mydomain.com

I've just added enties via web interface and all entries are without top level domain part.

nanopi@nanopi:~$ cat /etc/pihole/custom.list
192.168.178.1 fritz.box
10.0.40.4 wireguard-ipad
10.0.40.5 wireguard-marie-laptop
10.0.40.3 wireguard-sony-xz-compact
10.0.40.2 wireguard-thinkpad
10.0.40.1 wireguard-usg
10.0.10.190 Sony-XZ1-Compact
10.0.10.182 Thinkpad-Wifi
10.0.10.84 Marie-Asus-P50IJ
10.0.10.215 Marie-Windowsphone
10.0.99.192 Chromecast-Audio-Wohnzimmer
10.0.99.33 Chromecast-Audio-Schlafzimmer
10.0.1.2 cloudkey
10.0.1.1 usg
10.0.10.6 omv
10.0.10.136 Thinkpad-Lan
10.0.1.3 switch
10.0.1.4 access-point
10.0.10.64 iPad
1.2.3.4 test

It is not the custom.list file that wants this.
Either definition -with or without a search suffix- is valid.

So it is likely your clients (or at least some of them) that request a local domain with its search suffix applied.

If you did extend all your local names now, you probably may irritate other clients that would use the flat hostname.
To prepare for both cases, I'd recommend to define your lines as follows:

192.168.1.5 coddc coddc.mydomain.com

As Local DNS records doesn't allow such definitions, you could edit /etc/hosts instead.

You might want to vote here: