From owner-freebsd-questions@FreeBSD.ORG Thu Jan 22 11:55:01 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7ED8216A4CE for ; Thu, 22 Jan 2004 11:55:01 -0800 (PST) Received: from 82-41-27-158.cable.ubr04.edin.blueyonder.co.uk (82-41-27-158.cable.ubr04.edin.blueyonder.co.uk [82.41.27.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 943D343D2F for ; Thu, 22 Jan 2004 11:54:59 -0800 (PST) (envelope-from andrew@cream.org) Received: from cream.org (spatula.flat [192.168.0.2]) by myriad.flat (Postfix) with ESMTP id BAFFCE2; Thu, 22 Jan 2004 18:47:18 +0000 (GMT) Message-ID: <40102AA0.1000009@cream.org> Date: Thu, 22 Jan 2004 19:55:12 +0000 From: Andrew Boothman User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jonathan Chen References: <20040122193236.GA55754@dogma.freebsd-uk.eu.org> <20040122193855.GB90949@grimoire.chen.org.nz> In-Reply-To: <20040122193855.GB90949@grimoire.chen.org.nz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Jonathon McKitrick cc: freebsd-questions@freebsd.org Subject: Re: Domain name for local network? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 19:55:01 -0000 Jonathan Chen wrote: > On Thu, Jan 22, 2004 at 07:32:36PM +0000, Jonathon McKitrick wrote: > >>If I have a couple of boxes in a home network that connects to the Internet >>via ppp, is there any way I can name my network? I don't want to register >>a name, just use it locally. This way I can refer to 'neptune.jonathon.org' >>or something similar rather than '10.0.0.1'. > > > You can name it anything you like. If it were me, I'd set up an > internal DNS which is authoritative for the local domain name you've > chosen. That way it'll pick up the local machines for the domain-name > but still work for non-local domains. I use this method all the time. If you look at the headers of this email you'll find that my mail server on my LAN refers to my desktop machine as "spatula.flat" which clearly isn't a valid domain name :) Here's how I set my local DNS up. Whenever I have to set it up again somewhere else I always struggle to get it right, so hopefully this'll help you out and mean that I can look it up in the archives next time I forget. :D I add the following to /etc/namedb/named.conf -- start -- zone "flat" { type master; file "flat.fwd"; }; zone "0.168.192.IN-ADDR.ARPA" { type master; file "0.168.192.rev"; }; -- end -- Create /etc/namedb/flat.fwd with : -- start -- ; Zonefile for .flat $TTL 86400 ;default ttl 1day @ IN SOA myriad.flat root.myriad.flat. ( 2003102501 ;serial number YYMMDDNN 28800 ;refresh 8 hours 7200 ;retry 2 hours 864000 ;expire 10 days 86400 ) ;min ttl 1 day NS myriad.flat. $ORIGIN flat. ewen IN A 192.168.0.1 spatula IN A 192.168.0.2 simmy IN A 192.168.0.2 guest0 IN A 192.168.0.100 guest1 IN A 192.168.0.101 guest2 IN A 192.168.0.102 myriad IN A 192.168.0.254 smtp IN PTR myriad.flat. mail IN PTR myriad.flat. pop3 IN PTR myriad.flat. imap4 IN PTR myriad.flat. -- end -- And create /etc/namedb/0.168.192.rev containing: -- start -- $TTL 86400 @IN SOA myriad.home. root.myriad.home ( 200401080 86400 7200 8640000 86400 ) IN NS myriad.home. 1 IN PTR ewen.flat. 2 IN PTR spatula.flat. 3 IN PTR simmy.flat. 4 IN PTR spatula.home. 100 IN PTR guest0.flat. 101 IN PTR guest1.flat. 102 IN PTR guest3.flat. 254 IN PTR myriad.flat. -- end -- Hopefully they're not to difficult to understand. The syntax of the files is pretty specific though. Oh and you need named_enable="YES" in /etc/rc.conf Mail back if you have any problems! Andrew