I'm trying to set a DD-WRT router to reply to DNS requests with it's own hostname (via the DD-WRT router's DNSMasq daemon). I can set other local hostnames (using Static Leases section) and these are returned in DNS queries from the DD-WRT router. But adding the DD-WRT router hostname to it's own mapping of DNS name → IP results in failed DNS hostname lookups.
I'm able to create DNS entries for other hosts on the local network. I did this using by adding entries under Static Leases (under Services → Services → Services Management → DHCP Server → Static Leases). Each entry consists of MAC Addresss, Hostname, IP Address, Client Lease Time. However, an entry for the DD-WRT router itself has no affect (yes, using the LAN-facing MAC Address of the DD-WRT router).
Related DHCP and DNSMasq settings
- LAN Domain has string "
- Used Domain is "LAN & WLAN"
- DNSMasq is Enable
- Local DNS is Enable
- Query DNS in Strict Order is Enable
For example, there is an Static Leases entry for "
PC1". From a different domain host (computer on the same LAN) I can successfully do
$ ping PC1.mydomain
Yet, a similar Static Leases entry "
myrouter" exists for the LAN MAC of the DD-WRT router (yes, I am aware the DD-WRT LAN will not request a LAN-side IP via DHCP. The router has a static IP 192.168.1.1. I was trying this to achieve parity with the successful case).
Additional DNSMasq Options
Also, I added to Additional DNSMasq Options these lines
Then I restarted dnsmasq
$ stopservice dnsmasq $ startservice dnsmasq
Yet, name lookup for myrouter.mydomain still fails
$ ping myrouter.mydomain ping: myrouter.mydomain: Name or service not known
Oddly, I did not have this name lookup problem before a recent upgrade of the DD-WRT router.