Find the answer to your Linux question:
Results 1 to 7 of 7
I currently have a number of servers running on my home network. All of them behind one router. I was wondering if it is possible to set up a DNS ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Posts
    19

    Local DNS behind NAT.


    I currently have a number of servers running on my home network. All of them behind one router. I was wondering if it is possible to set up a DNS server inside of the NAT so that any machine on the network can access any other via hostname.

    Does it matter that I am behind a router? What should I google in order to learn more about doing this? Any good guides on setting up a DNS server?

  2. #2
    Just Joined!
    Join Date
    Sep 2012
    Posts
    12
    I am not sure about good guides as it is a long time since I originally did this but what you are looking for is a forwarding or caching DNS server. Something like this looks okay - digitalocean.com/community/tutorials/how-to-configure-bind-as-a-caching-or-forwarding-dns-server-on-ubuntu-14-04

    In my own personal setup, the router has bind9 running on it. It has DNS records for all of my local machines and looks to one of several DNS servers for non local records and caches the responses so subsequent lookups are faster as long as its within the TTL.

    The second part of this is configuring the local machines to use that DNS server. If your machines have fixed IP's then you need to modify the individual configs or if you are running your own DHCP server, modify that to provide the IP of your local DNS.

    One other thing to consider, if your DNS server isn't running on your router then maybe serve up a second DNS server IP in case the machine your running the DNS server on is down. In my config this is a non-issue as the router is also the DNS server. If the router is down nothing has external access anyway.

  3. #3
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,317
    A simpler approach might be to put them in your hosts file.

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    896
    Quote Originally Posted by DmobbJr View Post
    I currently have a number of servers running on my home network. All of them behind one router. I was wondering if it is possible to set up a DNS server inside of the NAT so that any machine on the network can access any other via hostname.

    Does it matter that I am behind a router? What should I google in order to learn more about doing this? Any good guides on setting up a DNS server?
    Yes, you can do this no problem. Just setup a DNS service on one of your boxes, point the other hosts to use that box for DNS. On the DNS server, use your router's IP for DNS to resolve external requests.

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,600
    Having set up DNS services for some networks I have managed, I would agree with gregm that configuring a common /etc/hosts file for all of your local home network servers would be more efficient, and less error prone. Configuring DNS properly is a royal PITA, which having had to do that a number of times I can say with confidence!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #6
    Just Joined! rodrigorootrj's Avatar
    Join Date
    Aug 2014
    Location
    Rio de Janeiro
    Posts
    3
    It depends on your environment.

  7. #7
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,288
    Hi.

    I have had good results with
    Code:
    dnsmasq - Small caching DNS proxy and DHCP/TFTP server
    It seems to be available in the repositories of many distributions. I use it on a Debian server.

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •