What's new

Using RT-N66U as Local DNS server

  • 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!

zoldy

Occasional Visitor
hello everyone. I have been doing some research on a problem I have on my local home network. I need the use of a local DNS server to resolve some internal network names. installing a windows DNS server for this was not practical. I had read that when using ASUSWRT-Merlin you can accomplish this. But my research has yet to uncover the "how to" I have already loaded the firmware and looks and works great. What steps to I need to do in order to enable local DNS resolves and how to I enter them.

Thanks in advance for your time.
 
You just need to add your hosts to the /etc/hosts file.

  1. Enable/format JFFS if you haven't already
  2. Create /jffs/configs/hosts.add with your host IP addresses and names
  3. Reboot

Your hosts.add file should contain content like this:

Code:
1.2.3.4 my.host.name
1.2.3.5 other.host.name
1.2.3.6 hostwithoutdomain
 
Last edited:
Host

thank you for the reply. I followed the directions. And although the hosts file does now contain my entry after reboot I listed the file to confirm ... however it does not resolve the name. In fact there are a couple of other entries in there by default that also do not work. Is there a reason my router may be ignoring the hosts file?
 
Hi Zoldy,
if the router have the DHCP enabled it should works with out any change, if instead you use static IP you have to supplay the host_ip and host_name in the host file .
In any case we need more info on your setting ( DHCP, lan mask , ecc.. ).
I have the DHCP on mine and all work OK.
:)
 
DHCP is enable and working... LAN is pretty standard

192.168.1.x
255.255.255.0
192.168.1.1

DNS is 192.168.1.1 (the router)
 
If this helps here is the contents of my dnsmasq.conf file and hosts file. The last entry in the host file was substituted for reference only but that is the one I am appending using hosts.add file.

pid-file=/var/run/dnsmasq.pid
user=nobody
resolv-file=/tmp/resolv.conf
no-poll
interface=br0
min-port=4096
no-negcache
cache-size=1500
dhcp-range=lan,192.168.1.100,192.168.1.254,255.255.255.0,86400s
dhcp-lease-max=253
dhcp-authoritative
dhcp-option=lan,3,192.168.1.1
dhcp-option=lan,6,192.168.1.1,0.0.0.0
dhcp-option=lan,44,192.168.1.1
read-ethers
addn-hosts=/etc/hosts.dnsmasq

and here is the hosts file


127.0.0.1 localhost.localdomain localhost
192.168.1.1 router.asus.com
192.168.1.1 www.asusnetwork.net
192.168.1.1 www.asusrouter.com
192.168.1.1 RT-N66U. RT-N66U
192.168.1.99 myhost.com
 
Hi Zoldy,

I have over 20 statics ip and did not have to add any host file. I can ping nas or ping wdlxtv and have those machine replied. I think there is option to make the router to be 'Master Browser' which should help this.
 
FYI.. if this helps ... router.asus.com is resolving to an ASUS.com external IP.. don't know if this is a clue or not?
 
I just tried pinging those hosts from the router itself using network tools and they resolved to local hosts properly? Is this perhaps another clue?
 
I just tried pinging those hosts from the router itself using network tools and they resolved to local hosts properly? Is this perhaps another clue?

If resolution is OK from the router but not from the client, then I would double check those clients to ensure that they do use the router's IP for their DNS. Under Windows you can check with the following command:

Code:
ipconfig /all
 
FYI.. if this helps ... router.asus.com is resolving to an ASUS.com external IP.. don't know if this is a clue or not?

I have a dual boot box with both linux and windows and noticed the same behavior when I attempted to access the web ui from windows. From linux router.asus.com resolves properly, but from windows it resolves to an asus IP address. I haven't yet had a chance to investigate why.

Edit:
It seems my issue is because of IPv6. Windows seems to prefer the Comcast IPv6 DNS server to the router's IPv4 DNS server.
Code:
>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : khopesh
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Atheros AR8121/AR8113/AR8114 PCI-E Ethern
et Controller
   Physical Address. . . . . . . . . : 00-22-XX-XX-XX-XX
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2601:1:XXXX:XXXX:XXXX:XXXX:XXXX:efd4(Prefer
red)
   Temporary IPv6 Address. . . . . . : 2601:1:XXXX:XXXX:XXXX:XXXX:XXXX:f54a(Prefer
red)
   Link-local IPv6 Address . . . . . : fe80::XXXX:XXXX:XXXX:efd4%10(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.20.20.21(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Monday, August 26, 2013 5:26:40 PM
   Lease Expires . . . . . . . . . . : Tuesday, August 27, 2013 5:26:40 PM
   Default Gateway . . . . . . . . . : fe80::XXXX:XXXX:XXXX:38b8%10
                                       10.20.20.1
   DHCP Server . . . . . . . . . . . : 10.20.20.1
   DHCPv6 IAID . . . . . . . . . . . : 234889749
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-18-D5-XX-XX-XX-XX-XX-XX-XX-XX

   DNS Servers . . . . . . . . . . . : 2001:558:feed::2
                                       2001:558:feed::1
                                       10.20.20.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

>nslookup router.asus.com
Server:  cdns02.comcast.net
Address:  2001:558:feed::2

Non-authoritative answer:
Name:    router.asus.com
Address:  103.10.4.99

>nslookup router.asus.com 10.20.20.1
Server:  router.asus.com
Address:  10.20.20.1

Name:    router.asus.com
Address:  10.20.20.1
 
Last edited:
If this helps here is the contents of my dnsmasq.conf file and hosts file. The last entry in the host file was substituted for reference only but that is the one I am appending using hosts.add file.

pid-file=/var/run/dnsmasq.pid
user=nobody
resolv-file=/tmp/resolv.conf
no-poll
interface=br0
min-port=4096
no-negcache
cache-size=1500
dhcp-range=lan,192.168.1.100,192.168.1.254,255.255.255.0,86400s
dhcp-lease-max=253
dhcp-authoritative
dhcp-option=lan,3,192.168.1.1
dhcp-option=lan,6,192.168.1.1,0.0.0.0
dhcp-option=lan,44,192.168.1.1
read-ethers
addn-hosts=/etc/hosts.dnsmasq

and here is the hosts file


127.0.0.1 localhost.localdomain localhost
192.168.1.1 router.asus.com
192.168.1.1 www.asusnetwork.net
192.168.1.1 www.asusrouter.com
192.168.1.1 RT-N66U. RT-N66U
192.168.1.99 myhost.com

What are your router settings for the following:

LAN/DHCP Settings tab
RT-N66U Domain Name:

WAN/WAN DNS Setting
Connect to DNS Server automatically:
 
Your computer is probably bypassing the router and going straight to Comcast's DNS then. You will need to figure out a way to not use these DNS. Unfortunately I have no idea how, as I only have access to IPv6 tunnels here - I simply leave the IPv6 DNS entries empty on the IPv6 page, as my ISP's regular DNS can resolve IPv6 IPs.
 
Your computer is probably bypassing the router and going straight to Comcast's DNS then. You will need to figure out a way to not use these DNS. Unfortunately I have no idea how, as I only have access to IPv6 tunnels here - I simply leave the IPv6 DNS entries empty on the IPv6 page, as my ISP's regular DNS can resolve IPv6 IPs.

Oh, I'm not worried about it, I just had never looked into it before. Judging from OP's reply, he seems to be picking up an external DNS server somewhere also.
 
thanks for all the replies. the windows machines are using the router as a DNS server and it is the only one specified.

LAN/DHCP Settings tab
RT-N66U Domain Name: Blank

WAN/WAN DNS Setting
Connect to DNS Server automatically: No
 
Just a quick fill in regarding the last post, maybe not the related to what you guys discussed. But I remembered that my rt-ac66u domain name is the same as every other machines in network, not blank. I'm not sure if they are "pingable" if not in the same domain.
 
thanks I tried putting in the name as a test but made no difference...

In my case the router is using the hosts file when pinging from the router itself

however it does not when answering client DNS requests.
 
i think I may have just figured it out. My work system is using VPN to connect to my work... disconnect VPN and it works.

My other computer I was testing with also using a private VPN account. disconnect and works fine....

My oversight and i am not sure if there is anyway around this?
 
i think I may have just figured it out. My work system is using VPN to connect to my work... disconnect VPN and it works.

My other computer I was testing with also using a private VPN account. disconnect and works fine....

My oversight and i am not sure if there is anyway around this?

No simple solution, short of configuring the VPN client to not use the remote DNS server (which can create other issues, such as being unable to resolve hostnames on the remote network).
 
I remember that behavior years ago when I began my first vpn session to connect to work... windows live messenger got disconnected, pending download session got interrupted and access to my local nas was impossible. I just accepted that it is "work network" and "my network" both isolate. Never thought about dns as Merlin suggested :)
 

Similar threads

Sign Up For SNBForums Daily Digest

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