Router – Managing a DNS on a Local Private WAN Network

binddomain-name-systemrouterwide-area-network

I am in need of some assistance figuring out how to set up a DNS on my private WAN network. I currently use a Linksys e4200 wireless router to connect all of my computers, servers, and other devices on a WAN. I would like to be able to set up a name server so that I can talk to all of my servers/computers without having to use IP addresses. As far as I have found I have three options, some of which are more straightforward and clear than others. All of the options I realize will require setting up static IP addresses for any devices I would like to assign a name to:

  1. Edit the host files on all of my machines to resolve my chosen names to specific IP addresses.
    • The issue with this choice is that I would have to do perform this action on all of my devices, and maintaining consistency would be difficult. I could provision all of my devices using Ansible, which would make it much simpler, but I'd ideally like to avoid this route.
  2. Flash DD-WRT to my e4200 and use DNSMasq to run a DNS on the router.
    • I will likely flash DD-WRT to my router even if I don't choose this option, but I would prefer my third choice.
  3. Set up a DNS server running BIND9 to resolve all of my local domain names, and forward unknown names to an external DNS server and cache completed resolutions to external websites.
    • This would give me the most flexibility, practice for performing DNS setups, and is my preferred method.
    • The only issue with this approach is that I have no clue where this DNS server should be in my network, or how to point requests to it without modifying all of my devices to use it's local IP address as their DNS server. Please forgive me if that assumption is incorrect, as I am definitely fumbling around here in this approach. The setup of BIND9 seems like something I could work through, I just don't know where to hook in the DNS server, and I'd love some assistance/advice.

Best Answer

I'd go with the third option, you can place it anywhere you'd like on your network, I usually set networks up in a similar manner, .1 as the router, .2 as the first DNS server, so on. Plus it's easier to type if you're assigning the address to more than a few PCs :)

You will have to add the IP to your machines to allow them to resolve domain names locally, or you could distribute the address via DHCP, if you decided to use DHCP to distribute IPs mapped to MAC addresses, so the same IP will always be assigned to the same computer, meaning it will always have the same hostname, etc. It would probably be less work just to add the IP to whatever method the computer uses for defining DNS server though.

Related Topic