Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2001 07:56:17 -0500
From:      "Oliver, Michael W." <oliver.michael@gargantuan.com>
To:        'Simon J Mudd' <sjmudd@pobox.com>, freebsd-questions@freebsd.org
Cc:        "'anthony@freebie.atkielski.com'" <anthony@freebie.atkielski.com>
Subject:   RE: /etc/hosts vs. DNS for local-only machines
Message-ID:  <1DA741CA6767A144BAA4F10012536C27A92F@LKLDDC01.GARGANTUAN.COM>

next in thread | raw e-mail | index | archive | help
You could also set up views in BIND 9.1.3, which I just did yesterday for
the first time.  Pretty cool, but took a while since I couldn't find many
docs on it.  Check out http://sysadmin.oreilly.com/news/views_0501.html for
some good info.  Also, BIND 9.1.3 supports IPv6, so you will be ready when
the time comes ;-)

===========
Michael Oliver 








-----Original Message-----
From: Simon J Mudd [mailto:sjmudd@pobox.com] 
Sent: Friday, December 14, 2001 7:25 AM
To: freebsd-questions@freebsd.org
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?1DA741CA6767A144BAA4F10012536C27A92F>