how do I do that?Assuming the client is using the router as its DNS server you could edit the hosts file on the router. But the change would be lost when the router was rebooted or changes are made in the GUI.
cd /etc
echo "104.199.65.124 ap-gew4.spotify.com" >> hosts
cat hosts
killall -s SIGHUP dnsmasq
nslookup ap-gew4.spotify.com
how do I do that?Log into the router using SSH or Telnet and append the required line to the end of the file:
Download putty, https://www.putty.org/ make sure SSH is on in Administration - System (LAN Only), enter root (router) ip in putty, usually 192.168.1.1 and port, click connect, log in with router credentials, and have fun.how do I do that?
ssh <user>@router.asus.com 'echo "104.199.65.124 ap-gew4.spotify.com" >> //etc//hosts'
I thought that as well but had to go back and add that to my original post because it wasn't doing that. The reason being thatNOTE: You shouldn't need to restart DNSMasq. It actively monitors //etc//hosts for changes. At least I never had to do so when using Merlin (maybe OEM is different?) for my DNS monitoring utility, which changes that file in order to enable/disable the WAN connectivity check.
dnsmasq.conf
contains no-poll
. Maybe stock firmware is different.killall -s SIGHUP dnsmasq
I thought that as well but had to go back and add that to my original post because it wasn't doing that. The reason being thatdnsmasq.conf
containsno-poll
. Maybe stock firmware is different.
An alternative to the restart is to send SIGHUP to the process:
In fact, I'll go back and change that in my previous post.Code:killall -s SIGHUP dnsmasq
ssh <user>@router.asus.com 'echo "104.199.65.124 ap-gew4.spotify.com" >> //etc//hosts; killall -s SIGHUP dnsmasq'
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!