Local DNS name not working

Hi , i would like to use DNS name , but it is not working .

i ' ve install pihole on my raspberrypi3 with raspbian bullseye OS .
i added for a test in " LOCAL DNS " => DNS RECORDS an entry like this :
baby 192.168.1.135
and the entry was successfulyl added .
So , in my ubuntu system , in my terminal i enterred this command :

iznobe@iznobe-PC:~$ ping -c2 baby
ping: baby: Nom ou service inconnu
iznobe@iznobe-PC:~$ ping -c2 baby.lan
ping: baby.lan: Nom ou service inconnu
iznobe@iznobe-PC:~$
iznobe@RPI3:~ $ cat /etc/pihole/custom.list
192.168.1.135 baby
iznobe@RPI3:~ $ dig baby

; <<>> DiG 9.16.48-Raspbian <<>> baby
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2160
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

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

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

;; Query time: 40 msec
;; SERVER: 80.67.169.12#53(80.67.169.12)
;; WHEN: Wed May 22 21:42:30 CEST 2024
;; MSG SIZE  rcvd: 109

iznobe@RPI3:~ $

not working !
have i done anything wrong ?

My pi is set up to use DNS Over HTTPS with FDN servers , but it not use them :

iznobe@RPI3:~ $ dig RPI3.pi.hole

; <<>> DiG 9.16.48-Raspbian <<>> RPI3.pi.hole
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27348
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

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

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

;; Query time: 30 msec
;; SERVER: 80.67.169.12#53(80.67.169.12)
;; WHEN: Wed May 22 21:09:14 CEST 2024
;; MSG SIZE  rcvd: 116

iznobe@RPI3:~ $
iznobe@RPI3:~ $ sudo systemctl status cloudflared
● cloudflared.service - cloudflared DNS over HTTPS proxy
     Loaded: loaded (/etc/systemd/system/cloudflared.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-05-21 07:17:13 CEST; 1 day 14h ago
   Main PID: 716 (cloudflared)
      Tasks: 11 (limit: 1595)
        CPU: 8min 24.135s
     CGroup: /system.slice/cloudflared.service
             └─716 /usr/local/bin/cloudflared proxy-dns --port 5053 --upstream https://ns0.fdn.fr/dns-query --upstream https://ns1.fdn.fr/dns-query

mai 22 19:41:40 RPI3 cloudflared[716]: 2024-05-22T17:41:40Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 19:47:14 RPI3 cloudflared[716]: 2024-05-22T17:47:14Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 19:47:43 RPI3 cloudflared[716]: 2024-05-22T17:47:43Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 19:48:05 RPI3 cloudflared[716]: 2024-05-22T17:48:05Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 19:48:05 RPI3 cloudflared[716]: 2024-05-22T17:48:05Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 19:57:23 RPI3 cloudflared[716]: 2024-05-22T17:57:23Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 19:57:23 RPI3 cloudflared[716]: 2024-05-22T17:57:23Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 20:53:58 RPI3 cloudflared[716]: 2024-05-22T18:53:58Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 20:56:15 RPI3 cloudflared[716]: 2024-05-22T18:56:15Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
mai 22 21:03:32 RPI3 cloudflared[716]: 2024-05-22T19:03:32Z ERR failed to connect to an HTTPS backend "https://ns0.fdn.fr/dns-query" error="failed to perform an HTTPS request: Post \"https://ns0.fdn.fr/dns-query\": unexpected EOF"
iznobe@RPI3:~ $ 
iznobe@RPI3:~ $ cat /etc/default/cloudflared
# Commandline args for cloudflared, using Cloudflare DNS
CLOUDFLARED_OPTS=--port 5053 --upstream https://ns0.fdn.fr/dns-query --upstream https://ns1.fdn.fr/dns-query

#CLOUDFLARED_OPTS=--port 5053 --upstream https://1.1.1.1/dns-query --upstream https://1.0.0.1/dns-query
iznobe@RPI3:~ $

Any help would be great appreciated .

Whats the purpose of editing a 2yr old thread adding just a word to the title and a comment at end?

Hi , i think you have'nt seen correctly the created date :

  • created

34m

  • [

last reply

](Local DNS name not working - #2 by CallMeCurious)

8m

  • 1

reply

  • 10

views

  • 2

users

lol - I read this timestamp and not this 2024-05-22T

Apologies mate.

no problem :wink:

It's looking out side the local network for resolution ( 80.67.169.12 ).

Do you get a different result if you dig@(your pihole ip) baby ie dig@192.168.1.3 baby

this is FDN 's IP servers . i think this is due to the DOH set up .

if i dig my pi's ip :

iznobe@iznobe-PC:~$ dig 192.168.1.132

; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> 192.168.1.132
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11621
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;192.168.1.132.			IN	A

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

;; Query time: 328 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Wed May 22 22:16:04 CEST 2024
;; MSG SIZE  rcvd: 117

iznobe@iznobe-PC:~$

It's looking out side the local network for resolution ( 80.67.169.12 ).

yes , but it should looks before in cache DNS or as it is write in the dedicated page :

Note:

The order of locally defined DNS records is:

  1. The device's host name and pi.hole
  2. Configured in a config file in /etc/dnsmasq.d/
  3. Read from /etc/hosts
  4. Read from the "Local (custom) DNS" list (stored in /etc/pihole/custom.list)

Only the first record will trigger an address-to-name association.

before searching outside on the external DNS no ?

@CallMeCurious

I think your intention was to ask to run:
dig @192.168.1.3 baby

Details

When you need to add an at symbol (@) inside a command, you need to surround it with backtiks (`), like this:

command `dig @PI-hole_IP domain`

(or just select the command and press CTRL+E)

1 Like

Yes. I was just editiing that.

@Iznobe_D please try dig @192.168.1.132 baby and lets see what you get.

hi, seems to work with :

iznobe@iznobe-PC:~$ dig @192.168.1.132 baby

; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> @192.168.1.132 baby
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49901
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
baby.			0	IN	A	192.168.1.135

;; Query time: 0 msec
;; SERVER: 192.168.1.132#53(192.168.1.132) (UDP)
;; WHEN: Thu May 23 12:19:50 CEST 2024
;; MSG SIZE  rcvd: 50

iznobe@iznobe-PC:~$

So the pihole custom list is working ok.

I'm not familiar with the cloudflared setup but reading through the guide cloudflared (DoH) - Pi-hole documentation it shows a test for it. From the pihole itself the command below and post results please.

dig @127.0.0.1 -p 5053 google.com

voici :

iznobe@RPI3:~ $ dig @127.0.0.1 -p 5053 google.com

; <<>> DiG 9.16.48-Raspbian <<>> @127.0.0.1 -p 5053 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62780
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 97a657d4b165058b (echoed)
;; QUESTION SECTION:
;google.com.			IN	A

;; ANSWER SECTION:
google.com.		299	IN	A	172.217.20.206

;; Query time: 269 msec
;; SERVER: 127.0.0.1#5053(127.0.0.1)
;; WHEN: Thu May 23 13:16:57 CEST 2024
;; MSG SIZE  rcvd: 77

iznobe@RPI3:~ $

That looks correct so the cloudflared service looks to be working. Looking at the pihole webgui, is the upstream server set to custom ipv4 / 127.0.0.1#5053?

yes ,this is good .

seen in the previous commande :

SERVER: 127.0.0.1#5053(127.0.0.1)

ok , so just re-tested to acces to my server " baby " and now working as excpeted .
Don't know what happened , just done a reboot yesterday night , and now all seems to be fine .

Thanks :wink:

I suspect that one client was connected to a vpn or something like that. It would explain the out of network server that was returned. Either way, glad its working for you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.