I have a Raspberry Pi 2 running Pi Hole 5.2.2 and Cisco Linksys E2000 router running DD-WRT v24-sp2 (08/12/10) std-usb-ftp
I want to be able to have PiHole resolve a DNS entry such as MyDevice to an ip address such as 192.168.2.8 so when i navigate to http://Mydevice I go to the same page as http://192.168.2.8
I have PiHole configured as my DNS and DHCP servers, the router config as below: (pi hole is @ 192.168.2.10)
I have managed to achieve what i want, but only for those devices that are assigned an IP by the PiHole DHCP server, those clients that have their own static IP cannot connect via this method.
I have added
192.168.2.8 MyDevice
to both /etc/hosts and /etc/pihole/local.list
I have added a record to PiHoles DNS Record screen as follows:
and a CNAME record:
From my windows PC with a static IP, this setup allows me to browse to
http://mydevice.local
which brings me to the same screen as
http://192.168.2.8
but
http://mydevice does not resolve.
If I change from a static IP to a dynamic IP, both http://mydevice.local and http://mydevice resolve to http://192.168.2.8 as expected
nslookups and pings from the windows machine:
C:\Users\Me>nslookup mydevice
Server: PiHole.lan
Address: 192.168.2.10
Name: mydevice.lan
Address: 192.168.2.8
Aliases: mydevice
C:\Users\Me>nslookup mydevice.lan
Server: PiHole.lan
Address: 192.168.2.10
Name: mydevice.lan
Address: 192.168.2.8
C:\Users\Me>ping mydevice
Ping request could not find host mydevice. Please check the name and try again.
C:\Users\Me>ping mydevice.lan
Pinging mydevice.lan [192.168.2.8] with 32 bytes of data:
Reply from 192.168.2.8: bytes=32 time<1ms TTL=64
Reply from 192.168.2.8: bytes=32 time<1ms TTL=64
I have tried
- just having the entry in
/etc/hosts(with no DNS record or CNAME record) - just having the entry in
/etc/pihole/local.list(no DNS record or CNAME record) - DNS and CNAME record configured but neither
/etc/pihole/local.listnor/etc/hosts
and all give the same behaviour (I restarted the DNS after each change with pihole restartdns)
What have I missed?
(I have asked this question on this forum over a year ago and am now revisting the problem. However, due to a new router, different router / pi hole configs and a new major version of PiHole since I asked that question, I felt it warranted a new question)


