2

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 ServicesServicesServices ManagementDHCP ServerStatic 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 "mydomain"
  • 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

local=/mydomain/
expand-hosts

Then I restarted dnsmasq

$ stopservice dnsmasq
$ startservice dnsmasq

Still fails

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.

0

In section Additional DNSMasq Options (under ServicesServicesServices ManagementDHCP ServerStatic Leases), add the following line

address=/myrouter.mydomain/192.168.1.1


Suggestion is from this old forum post. The address parameter is explained at the dnsmasq man page (search for "--address=").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.