Date: 14 Dec 2001 13:25:10 +0100 From: Simon J Mudd <sjmudd@pobox.com> To: freebsd-questions@freebsd.org Subject: Re: /etc/hosts vs. DNS for local-only machines Message-ID: <86pu5i2dll.fsf@unicorn.ea4els.ampr.org> In-Reply-To: <018701c18488$24f3a310$0a00000a@atkielski.com> References: <018701c18488$24f3a310$0a00000a@atkielski.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86pu5i2dll.fsf>
