Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I want to solve the following problem:
My Debian (Woody) box is intermittently connected with the Net at various locations. The default install left my box with a name "laptop.localdomain.fake". Of course I could change it. But it occured to me, that this is a good opportunity. I could administer the domain ".fake" locally and could name all resources "*.provider.fake" if they are provided by my connection or "*.localdomain.fake" if they are directly provided by my box. Unfortunately the bind-Nameserver wants to forward to an IP-Address and doesn't recognize a name there. So I can't use "nameserver.provider.fake" as an alias to the nameserver. I want to install a nameserver written in perl instead where I can modify such behavior.
My Question: Does anyone know of such a nameserver?

Replies are listed 'Best First'.
Re: DNS in Perl
by iburrell (Chaplain) on Nov 05, 2002 at 17:37 UTC
    Why do you want to alias all external names to a .fake domain? I don't see what advantage that brings. If you aren't connected, then you can't reach them. If you are connected, then the FQDN work fine. Of course you can't use domain names for forwarding; the DNS server can't resolve the name without knowing the IP address. The standard way to do intermittent connections is to rewrite the /etc/resolv.conf file to use the local DNS servers. If you want to use a local caching nameserver, then the connection scripts rewrite the forward section of /etc/named.conf.
      I don't want to rewrite /etc/resolv.conf,/etc/printcap,/etc... every time I connect. And I don't want to write a conf-rewriting program every time I install a program. The Nameserver could resolve the fake-names because it would be master for this domain.

        What are you trying to accomplish? Do you want name resolution to work regardless of provider? There are three standard solutions to this problem:

        1. Use provider nameservers. Change /etc/resolv.conf on connections.
        2. Use local nameserver with forwarding. Change /etc/named.conf.
        3. Use local caching nameserver. Change named.ca containing root name servers to use fake roots when disconnected. This makes lookup failures when disconnected fast.

        Are you trying to solve the problem of stable names for other services? You want to use the same name (smtp.fake) in sendmail config regardless of providers. Running a local nameserver for the .fake zone will do this. But then you need to change the .fake zone file on each connection. And change the forwarding line (or root zone file) as above to make the resolution of other names work. This is doable with BIND.

Re: DNS in Perl
by fglock (Vicar) on Nov 05, 2002 at 16:56 UTC