DNS - How to resolve locally first?

Discussion in 'Server Operation' started by bch, Aug 21, 2015.

  1. bch

    bch Member

    I have a single ISPConfig server on a VPS with Debian Jessie, ISPConfig It works perfect and runs all the services, including DNS.

    I have a similar local server at home with no incoming ports opened.

    I want to configure that local server so that when I am using it as my primary DNS at home, it serves some of the sites from the local server instead.

    I am trying to archive this:

    From outside:
    example.com -> www.example.com (works)

    From inside:
    www.example.com -> www.example.com (outside)
    example.com -> example.com (inside)

    My external server's hostname is www.example.com and it hosts DNS for itself.
    My internal server's hostname is dev.example.com.

    I have tried to set up the local DNS for example.com like the external but with local IP's (exept www)
    The result is that - if there now is no local DNS for any domain on the VPS - it all points to the local server.

    After som Googleling I wonder if I need to set up forward zones in Bind or similar?

    I would be happy to get a push in the right direction. Thanks in advance. :)
  2. TiTex

    TiTex Member

    if you need just one or two hostnames to be served from local network i would just use my /etc/hosts file and specify the names in there
    otherwise i think you need to do some tricks with split dns
  3. bch

    bch Member

    Thank you for your answer.

    I have been able to make it work by having the same records on the local server but pointing to the the local IP.

    The downside is if I create something.example.com I have to create DNS on both servers. I found this link where the "second method" may do it: http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/dns-split-horizon-common-server-names.html but I have not tried it yet.

    I have not been able to use the hosts file only - I have played around with dns-nameservers in /etc/network/interfaces and resolv.conf.

Share This Page