DNS IP resolution not working

Name resolution works:

$ dig galadriel.lan  @192.168.1.1

; <<>> DiG 9.10.6 <<>> galadriel.lan @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4807
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
galadriel.lan.		5	IN	A	192.168.1.233

;; Query time: 14 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Dec 05 08:57:29 CST 2020
;; MSG SIZE  rcvd: 58

Address resolution does not work:

$ dig -x 192.168.1.233 @192.168.1.1

; <<>> DiG 9.10.6 <<>> -x 192.168.1.233 @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 46426
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;233.1.168.192.in-addr.arpa.	IN	PTR

;; AUTHORITY SECTION:
233.1.168.192.in-addr.arpa. 10800 IN	SOA	233.1.168.192.in-addr.arpa. nobody.invalid. 1 3600 1200 604800 10800

;; ADDITIONAL SECTION:
explanation.invalid.	10800	IN	TXT	"Blocking is mandated by standards, see references on https://www.iana.org/assignments/locally-served-dns-zones/locally-served-dns-zones.xhtml"

;; Query time: 13 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Dec 05 08:57:55 CST 2020
;; MSG SIZE  rcvd: 267

/etc/config/dhcp:

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option localservice '1'
	option port '0'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'
	option ra_management '1'
	list dhcp_option '6,192.168.1.100'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'
	list dhcp_option '6,72.50.209.210'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config dhcp 'guest_turris'
	option interface 'guest_turris'
	option ignore '0'
	option start '100'
	option limit '150'
	option leasetime '3600'
	list dhcp_option '6,10.111.222.1'

config domain
	option ip '192.168.1.1'
	option name 'turris'

config host
	option dns '1'
	option mac 'B2:EA:0C:A5:B4:E1'
	option name 'ubuntu-focal'
	option ip '192.168.1.100'

I have Pi-hole installed on an Ubuntu instance installed on a LXC container at 192.168.1.100.

Have I mis-configured something?

No, this just doesn’t work ideally by default, but it’s easy to get it working. It’s sufficient to add one configuration line:

policy.add(policy.suffix(policy.PASS, {todname('1.168.192.in-addr.arpa')}))
1 Like

Add to /etc/config/resolver:

config resolver 'kresd'
	option rundir '/tmp/kresd'
	option log_stderr '1'
	option log_stdout '1'
	option forks '1'
	option keep_cache '1'
	list hostname_config '/etc/hosts'
	# custom configuration file
	option include_config '/etc/kresd/custom.conf'

then create/configure config file:

cd /etc/kresd
echo "policy.add(policy.suffix(policy.PASS, {todname('1.168.192.in-addr.arpa')}))" >> custom.conf

restart service:

/etc/init.d/resolver restart
1 Like