I want to redirect a domain to my computer, and make it as my development testing server, and at the same time, I don’t want to set the hosts on my computers and phones, the best way is set it on my router, so every devices connected this router could work.

There’s a simple way to change it, first, add “my-domain.com” to hosts file, and you cannot restart the router, or the hosts file would be reset, so how to let it work? You could execute the command followed to reload the hosts, and now it works.

killall -SIGHUP dnsmasq

But if you restart the router, you should set it again, it’s so boring.

Now I would try another method to do it. First, enable jffs on ASUS router.

nvram set jffs2_on=1
nvram set jffs2_enable=1
nvram set jffs2_format=1
nvram set jffs2_scripts=1
nvram commit

reboot now

When the router restarted, we could use a command to check if the jffs enabled already.

nvram show | grep jffs

If the jffs enabled, it would show information like this:

jffs2_auto_erase=0
jffs2_enable=1
jffs2_format=0
jffs2_on=1

And then, add the domain and ip information to “/jffs/configs/dnsmasq.conf.add”

address=/test.com/127.0.0.1
address=/test.com/::1

Or you could add “addn-hosts=/jffs/configs/hosts” into the dnsmasq.conf.add file, and you could set domains in “/jffs/configs/hosts”.

I don’t know why, the new version of ASUS Router cannot load the dnsmasq.conf.add. So I have to set it every time after restart the router.