Re: DNS Name Server with one IP address

From: Jeremy S Lowery (jlowery_at_internetpro.net)
Date: 01/27/04


Date: Mon, 26 Jan 2004 23:29:22 -0600

Along with the other great responses, I thought I'd share my interesting
setup with ya. I have the exact same hardware configuration as you, except
I have a dynamic dns.

I use www.no-ip.com's authoritive DNS servers with the registar. They offer
a service that lets me run a client and send my IP to them when it changes
so their records can reflect this (You don't have to worry about this).

My gateway box is also setup to be the authoritive nameserver on my domain.
However, since "the world" sees the authoritive ones as ns1.no-ip.com and
ns2.no-ip.com, it's only really authoritive to machines I tell it to be for
(in this case, my local network).

I did this so I could have all of my local machines (which have private IP's
and get NAT'ed through the gateway) use my domain.

Some example config:
I have gateway.mydomain.tld registered with no-ip to point to my gateway
box. the no-ip record has my internet ip.

I have bind9 on the gateway acting as the authority for my domain:

from named.conf:

zone "mydomain.tld" {
        type master;
        notify no;
        file "pri/mydomain.tld";
};

and my zone file for my domain:
$TTL 86400

@ IN SOA mydomain.tld. jlowery.mydomain.tld. (
                            2 ; Serial
                            8H ; Refresh 8 hours
                            2H ; Retry 2 hours
                            1W ; Expire 1 week
                            1D ; Minimum 1 day
                            )

                        NS gateway
                        MX 10 gateway.mydomain.tld
gateway A 192.168.1.1
www A 192.168.1.1

# some machines on my local network
oracle A 192.168.1.10
trinity A 192.168.1.11

The one thing to be sure of is keeping the gateway records in sync with my
external provider's records. if I put a cname on the external provider for
the gateway, I have to do it on the gateway too.

So as far as my local network is concerned, gateway controls mydomain.tld.
Oh, and also named.conf needs the "hints" record to be able to resolve
everything else.

zone "." IN {
        type hint;
        file "named.ca";
};

The only thing left to do is have all the local network machines use
192.168.1.1 (the gateway) as their nameserver.

So all the machines on my local network are using DNS for my domain (I only
have 5 but this is my network and I like playing :) and it works globally
as well.

if you resolve the gateway from the internet you get the external IP, if you
resolve it from the LAN you get the internal IP.

Jeremy



Relevant Pages

  • Re: DNS Name Server with one IP address
    ... My gateway box is also setup to be the authoritive nameserver on my domain. ... (in this case, my local network). ... I did this so I could have all of my local machines (which have private IP's ... I have bind9 on the gateway acting as the authority for my domain: ...
    (comp.os.linux.setup)
  • Re: DNS Name Server with one IP address
    ... My gateway box is also setup to be the authoritive nameserver on my domain. ... (in this case, my local network). ... I did this so I could have all of my local machines (which have private IP's ... I have bind9 on the gateway acting as the authority for my domain: ...
    (comp.os.linux.misc)
  • VPN/PPTP/ip/mail problem
    ... In the local network there is a mail/fileserver (sendmail, ... Also there is a gateway with local ip 10.0.0.1 and on the internetside ... A home user connects through pptp/vpn with a.b.c.d. ...
    (comp.os.linux.networking)
  • Re: Configuring router for static IP address on LAN
    ... as long as the IP the DHCP server allocates doesn't ... subnet mask and the default gateway. ... to get _off_ the local network out to the wider world. ... "Computer games don't affect kids; I mean if Pac-Man affected us ...
    (uk.comp.sys.mac)
  • Re: Convention User Woas
    ... gateway, they're not able to reach off the LAN either, as most operating ... Where they st00pid enough to not spoof the MAC address as well? ... and might see that the local network is ... with the destination address of 216.239.57.x to the MAC address of the ...
    (comp.dcom.lans.ethernet)