NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
perrynmyers
Sep 27, 2020Star
Support for addn_hosts in dnsmasq on Orbi RBR50
Hi, I'm reviving a topic from 2018/2019 that has been closed for inactivity, because the issue still exists and has not been resolved yet. This is related to the closed thread: https://community.ne...
FURRYe38
Sep 27, 2020Guru - Experienced User
Something to psot about here:
https://community.netgear.com/t5/Idea-Exchange-For-Home/idb-p/idea-exchange-for-home
Good Luck.
perrynmyers
Sep 27, 2020Star
Thanks for the suggestion. When NG Technical Support redirected me to the Community Forum to post this, they did not tell me where in the forum I should go.
I have posted it here now:
Thanks again :)
- FURRYe38Sep 27, 2020Guru - Experienced User
Good Luck. :smileywink:
- perrynmyersSep 27, 2020Star
Reposting this idea here, in case it helps someone out and Netgear doesn't implement support for this in the Orbi firmware itself.
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.
- carlovn66Mar 08, 2021Aspirant
Thanks for posting this. I found your post while searching for a solution to my router/modem not allowing NAT loopback. So I need my Orbi router to resolve my duckdns DNS name to a local IP Address.
I do have a little bit of Unix/Linux experience and I have used VI before. My question is: Where (in which folder) do I put your script? And also, is it possible to add your script to a crontab for automatic execution, either on a set schedule or "@reboot", or maybe add it to rc.local?
Thanks.