NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Hi, Almost all modern routers support local device name resolution using a dnsmasq feature called addn-hosts (or something similar). There seems to be no way to persistently set this feature in the ...
perrynmyers
Sep 27, 2020Star
In case anyone is interested in a bit of an extended hack, here's a script that you can use (using the expect utility in Linux) to log into the Orbi and configure dnsmasq programatically. This way when the Orbi reboots, you simply re-run the script.
It allows both usage of /tmp/dhcpd_hostlist which uses the name each client identifies with (which often can be unset) but it also allows you to put a hosts file on a FAT32 formatted USB stick and put that USB stick into the Orbi Router which on the RBR50 is accessible via /mnt/sda1
Script:
#!/usr/bin/expect set addn_hosts "addn-hosts=/mnt/sda1/hosts\naddn-hosts=/tmp/dhcpd_hostlist\n" set host "192.168.1.1" set user "admin" set password "********************" set timeout 20 spawn telnet $host expect "login:" send "$user\n" expect "Password:" send "$password\n" send "grep -qF addn-hosts /etc/dnsmasq.conf || (echo \'$addn_hosts\' >> /etc/dnsmasq.conf && echo 'addn-hosts added')\n" send "pidof dnsmasq\n" send "kill \$(pidof dnsmasq)\n" send "/usr/sbin/dnsmasq --except-interface=lo -r /tmp/resolv.conf\n" send "pidof dnsmasq\n"
If you don't want to supply a separate hosts file (in the format of ip_addr hostname, with each mapping being a separate line), then you can just remove the addn_hosts=/mnt/sda1/hosts from the addn_hosts variable in the script. This will make it so the only hosts file used is /tmp/dhcpd_hostlist
But if you format a USB drive as FAT32 (or vfat) and put a hosts file on it, you can then arbitrarily configure the Orbi DNS server with whatever local DNS names you want.
Hope this helps someone out.