From owner-freebsd-questions Fri Dec 14 5: 8:21 2001 Delivered-To: freebsd-questions@freebsd.org Received: from freebie.atkielski.com (ASt-Lambert-101-2-1-14.abo.wanadoo.fr [193.251.59.14]) by hub.freebsd.org (Postfix) with ESMTP id 882C937B417 for ; Fri, 14 Dec 2001 05:08:15 -0800 (PST) Received: from contactdish ([10.0.0.10]) by freebie.atkielski.com (8.11.3/8.11.3) with SMTP id fBED8DR03415; Fri, 14 Dec 2001 14:08:13 +0100 (CET) (envelope-from anthony@freebie.atkielski.com) Message-ID: <01b401c184a0$63bf74d0$0a00000a@atkielski.com> From: "Anthony Atkielski" To: , "Simon J Mudd" References: <018701c18488$24f3a310$0a00000a@atkielski.com> <86pu5i2dll.fsf@unicorn.ea4els.ampr.org> Subject: Re: /etc/hosts vs. DNS for local-only machines Date: Fri, 14 Dec 2001 14:08:14 +0100 Organization: Anthony's Home Page (development site) MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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" To: 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