Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Dec 1999 03:19:16 +1030
From:      wincent <wincent@dingoblue.net.au>
To:        <questions@FreeBSD.org>
Subject:   Local DNS on LAN Gateway with Multiple PPP Dialup Accounts
Message-ID:  <B46A4434.1881%wincent@dingoblue.net.au>

next in thread | raw e-mail | index | archive | help
Hi All

This is my first post to the list so please forgive me if my question has
already been answered... First of all a bit of background:

I've set up a FreeBSD box as a gateway machine for my home network. I've
followed the FAQs and docs so that I can dialup to my ISP with the FreeBSD
box and then the other machines on the home network can access the net
through the gateway, using NAT. It seems to work.

I have also set up a local DNS on the FreeBSD box. I have it set up to do
two things:

(1) Answer name queries about addresses *within* the home network
(2) Serve as a caching name server for queries *outside* of the home network

I do this by using the "forwarders" option in my named.conf file. I simply
specify the IP addresses of the nameservers at my ISP. The idea is, if the
gateway nameserver doesn't know the name, it just asks the ISP DNS. Next
time I ask the gateway nameserver, it *does* know the name because it holds
it cached. This seems to work too.

Note: I've set the DNS to ignore queries etc from machines outside of the
home network.

So at last we come to my question. The tricky part is that I have *two*
ISPs. I sometimes use one, sometimes the other. Depending on which one I
use, the IPs in my "forwarders" option in my named.conf need to be
different. The question is, what is the best way to switch between these
configurations?

So far, the best idea I've been able to come up with is to have two
named.conf files under different names (say "alternate" and "default"). When
I want to switch to the other configuration I would just type:

ndc stop
named -b /etc/namedb/named.conf.alternate &

To go back to the other:

ndc
named -b /etc/namedb/named.conf.default &

I have no idea whether there is a better way to do this, or if what I am
doing is Not A Good Thing (TM). The bad thing about the above method is that
I think the name daemon loses its cache every time it is stopped. Is that
right? Any way to avoid it? Anyway to change the forwarders options without
restarting named?

I'm running FreeBSD 3.3-RELEASE with the BIND 8 distribution that came on
the install CD.

Thanks a lot for your help
Cheers
Wincent



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?B46A4434.1881%wincent>