Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2001 14:08:14 +0100
From:      "Anthony Atkielski" <anthony@freebie.atkielski.com>
To:        <freebsd-questions@FreeBSD.ORG>, "Simon J Mudd" <sjmudd@pobox.com>
Subject:   Re: /etc/hosts vs. DNS for local-only machines
Message-ID:  <01b401c184a0$63bf74d0$0a00000a@atkielski.com>
References:  <018701c18488$24f3a310$0a00000a@atkielski.com> <86pu5i2dll.fsf@unicorn.ea4els.ampr.org>

next in thread | previous in thread | raw e-mail | index | archive | help
My situation is a little more bizarre in that I want the local hostnames to
be part of my external domain (atkielski.com).  Additionally, some of my
local hostnames duplicate external names but must point to a different
address (e.g., freebie.atkielski.com, the hostname of my FreeBSD box, points
to its local LAN address on my nameserver, but points to my external IP
address on the external nameserver that is authoritative for the domain as
seen by the rest of the world).

What I've done thus far is set up my own nameserver as the authoritative
server for my external domain (even though it's not), and then define
everything in my own zone files.  Since no server queries my server from the
outside, and since both of my own machines query my server first, this
should work, and it appears to work okay.  The DNS lookups are extremely
fast once an address is in cache, compared to the slowness of my ISP's
nameservers.

----- Original Message -----
From: "Simon J Mudd" <sjmudd@pobox.com>
To: <freebsd-questions@FreeBSD.ORG>
Sent: Friday, December 14, 2001 13:25
Subject: Re: /etc/hosts vs. DNS for local-only machines


> anthony@freebie.atkielski.com ("Anthony Atkielski") writes:
>
> > Anyway, is it better to define local hosts (those on my 10/24 LAN, not
> > visible from the Net) within DNS, or just within a /etc/hosts file?
>
> The easiest thing IMO is to setup each machine's local name in
> /etc/hosts and to use the DNS for the rest.
>
> >  If I define them in DNS, how can I ensure that the definitions are
> > visible only from my LAN, and that named will never try to resolve
> > them from a different DNS server?
>
> Define your own domain "domain.madeup" and make your name server the
> primary nameserver for this domain.  Create the zone file with your
> hosts and away you go.
>
> In /etc/namedb/named.conf
>
> zone "domain.makdeup" {
>         type master;
>         file "primaries/db.domain.madeup";
> };
>
> This will read a file with the domain information from
> /etc/namedb/primaries/db.domain.madeup.  You need to create this "zone
file".
>
> db.domain.madeup will have something like the following inside:
>
>
> $TTL 3600
> @ IN SOA host.domain.madeup. sjmudd.pobox.com. (
>                 10      ; serial
>                 10800   ; refresh 3 hours
>                 3600    ; retry after 1 hour
>                 604800  ; expire after 1 week
>                 86400 ) ; minimum ttl
>
>                 NS      host.domain.madeup..
>
>                 IN MX   10      mail.domain.madeup.
>
>
> localhost       IN A    127.0.0.1
> host            IN A    1.2.3.4
> mail            IN A    2.3.4.5
>
> etc.  You'll need to look at a book on zone files to set this up
> properly, but you should get the idea.
>
> If you now change /etc/resolv.conf to include
>
> search madeup.domain
>
> Then once you start named you should be able to do things like
>
> ping mail from host without having to specify anything else.
>
> Hope this helps, but do read up on BIND to set things up
> properly.
>
> Simon
> --
> Simon J Mudd,   Tel: +34-91-408 4878,  Mobile: +34-605-085 219
> Madrid, Spain.  email: sjmudd@pobox.com,  Postfix RPM Packager
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01b401c184a0$63bf74d0$0a00000a>