Can I use Gargoyle as my DNS server with an /etc/hosts file?

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
gargola
Posts: 1
Joined: Mon May 07, 2012 1:38 pm

Can I use Gargoyle as my DNS server with an /etc/hosts file?

Post by gargola »

I am interested in using Gargoyle. Thanks for the great work on the project.

One feature I'm not sure if it can support is being a DNS server which forwards any unresolved requests to my ISP's DNS server.

Of particular interest is setting up the /etc/hosts file on the router running Gargoyle with the contents of the MVP hosts file. This volunteer maintained file resolves many ads, banners, parasites, hijackers, and malware sites to localhost (127.0.0.1). I am not sure about the policy regarding placing links so I didn't link to it directly. A Google search for "MVP hosts" will locate it. The hosts file is ~1 MB in size.

By placing this host file on the router, it will negate the need to put it on each PC and also provides a solution for smartphones without access to their own hosts file (example: unrooted Android phones).

If it is possible, can you provide me with the following information:

1. How to set up Gargoyle to be the DNS server for DHCP clients.

2. How to transfer the ~1 MB hosts file to the router and place it in /etc/hosts.

3. Any steps needed to restart the DNS server to read the /etc/hosts file.

Thanks.

mix
Posts: 292
Joined: Sun Feb 27, 2011 11:18 am

Re: Can I use Gargoyle as my DNS server with an /etc/hosts f

Post by mix »

If you were actually using Gargoyle, I think you would have answered the questions you are asking yourself.

1) Gargoyle does this by default
2) Use WinSCP
3) Reboot the router
WRT54GL v1.1
Gargoyle 1.4.7

throughwalls
Posts: 89
Joined: Thu Apr 22, 2010 3:24 pm

Re: Can I use Gargoyle as my DNS server with an /etc/hosts f

Post by throughwalls »

mix wrote:If you were actually using Gargoyle, I think you would have answered the questions you are asking yourself.

1) Gargoyle does this by default
I actually use Gargoyle (and love it), but I do not know how to configure this. I also want to map abcxyz.com to 127.0.0.1, but I want all other unspecified domains to be resolved by my ISPs DNS servers. On which screen is it possible to specify this? Or is this something that has to be done at the command line and is specified somewhere else?

Mix, your knowledge would be very helpful here.

Donkey Hotay
Posts: 6
Joined: Wed May 30, 2012 6:55 pm

Re: Can I use Gargoyle as my DNS server with an /etc/hosts f

Post by Donkey Hotay »

Throughwalls, google and download WinSCP. It basically turns a SSH commandline session into a GUI experience with a file browser.

Login to your router by specifying the address and port (22 is default for SSH), selecting SCP as the file protocol.

After a couple of meaningless error popups (mine does, anyways), a window will appear that looks like a file manager. The left side is your PC's file structure and the right side is your router's. Navigate on the right side to the /etc/ folder. There is a file here named hosts. Double-click to open it and edit it as you see fit.

throughwalls
Posts: 89
Joined: Thu Apr 22, 2010 3:24 pm

Re: Can I use Gargoyle as my DNS server with an /etc/hosts f

Post by throughwalls »

Super. Thank you for the helpful reply!

Post Reply