What's new

Creating and Updating dnsmasq

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

idolza

New Around Here
Greetings Fellow Forumites,

I am an avid reader of the forum and a convert of Asuswrt-Merlin.

I am a bit of novice user when it comes to routers(except for the normal GUI tools), telnet, ssh and other shell commands required to really turn your router into more than it seems.

My search skills, along with my comprehension on some of what is required has failed me.

So now I call upon the collective knowledge and expertise of this forum to assist a novice user such as myself.

I currently have a "Chromecast" and a Roku unit - which I would like to use on my home network. Both of these units do not have an option to configure custom dns on the device. I make use of a RT-AC68U as my primary router.

The solution I have seen is to configure custom entries for the dnsmasq. This is now where I would like some assistance if possible.

Please can you assist me in providing me with step by step how to including commands :

- To assist me in getting to the actual location of the dnsmasq. (I've logged onto router via both SSH and Telnet and I end up in the following path - "ASUSWRT-Merlin RT-AC68U_3.0.0.4 Thu Mar 6 02:08:32 UTC 2014
admin@RT-AC68U:/tmp/home/root#")
- To advise me if I should access it via the gui "run cmd" on the web interface of should I use a tool such as putty to telnet or ssh into my device.
- To assist me in adding the "dnsmasq.conf.add" as suggested on the forum here.
- Then to add the following entries in the correct manner :
iptables -I PREROUTING -t nat -p udp -d 8.8.8.8 -dport 53 -j DNAT –to-destination 206.214.214.28
iptables -I PREROUTING -t nat -p udp -d 8.8.4.4 -dport 53 -j DNAT –to-destination 197.242.94.51

strict-order
server=/netflix.com/206.214.214.28
server=/netflix.com/197.242.94.51
server=/pandora.com/206.214.214.28
server=/pandora.com/197.242.94.51
server=/songza.com/206.214.214.28
server=/songza.com/197.242.94.51
server=/hulu.com/206.214.214.28
server=/hulu.com/197.242.94.51
server=/itv.com/206.214.214.28
server=/itv.com/197.242.94.51
server=/slacker.com/206.214.214.28
server=/slacker.com/197.242.94.51
server=/bbc.co.uk/206.214.214.28
server=/bbc.co.uk/197.242.94.51
server=/ROKU.COM/184.169.139.227
server=/ROKU.COM/50.22.147.234
server=/*ROKU.COM/184.169.139.227
server=/*ROKU.COM/50.22.147.234

IPS=`grep -i "^dhcp-host=.*CHROMECAST" /tmp/dnsmasq.conf | cut -d',' -f3`/32
for SOURCE in $IPS
do
iptables -t nat -A PREROUTING -i br0 -p udp -s $SOURCE --dport 53 -j DNAT --to `nvram get lan_ipaddr`
iptables -t nat -A PREROUTING -i br0 -p tcp -s $SOURCE --dport 53 -j DNAT --to `nvram get lan_ipaddr`
done

I thank you in advance for your assistance.
 
Last edited:
My multiple searches finally yielded some results and direction.

So in case any other person comes across this thread in the future.

I managed to get some of the information from these threads :

http://www.smallnetbuilder.com/forums/showthread.php?t=8266&page=4

http://forums.smallnetbuilder.com/showthread.php?t=8785

http://forums.smallnetbuilder.com/showthread.php?t=13751

I used "putty.exe" to connect to my router via telnet.
navigated to the "cd /jffs/configs"
created my file as follows :
cat >dnsmasq.conf.add
("copied and pasted from text file - info available from this post(I substituted the Unblock IPs with those of Unotelly) : http://www.smallnetbuilder.com/forums/showpost.php?p=68708&postcount=46") <Ctrl+D>
Followed by chmod a+rx

Reboot.

Time got the better of me as I needed to head off to work, will fully test it this evening.

I am also looking at creating a CRON job(which I know nothing about as yet, I will pretty soon - that's for sure) , which I read about on here : http://www.smallnetbuilder.com/forums/showthread.php?t=7047&page=7

To facilitate my chromecast - I also found the following information on the forum to update my IPtables :
iptables -t nat -A PREROUTING -d 8.8.8.8 -j DNAT --to-destination 176.67.84.19
iptables -t nat -A PREROUTING -d 8.8.4.4 -j DNAT --to-destination 178.79.166.52
iptables -t nat -A POSTROUTING -s 176.67.84.19 -j SNAT --to-source 8.8.8.8

So more experimentation to come and more calls on the collective might of the forum, should I crash and burn.
 
Glad you found your way around your router.
Use WinSCP to browse files on the router to get a better understanding of what and where you are changing things. You can directly create and change files with it.
Use PuTTY to execute commands, you can much better follow the output and look at the history of what you were doing.
Read the documentation for your router, it's the second sticky post in this forum. Adding a cron job is simple if your read the documentation.
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top