[Resolvconf-devel] Bug#506761: [resolvconf] About debian bug 506761

Bastien ROUCARIES roucaries.bastien at gmail.com
Fri Aug 7 10:22:59 UTC 2009


Le vendredi 7 août 2009 11:06:35, Thomas Hood a écrit :
> Hello Bastien,
>
> Bastien ROUCARIES wrote:
> > I want to use something like this in my network.conf file for using dns
> > root server [1] :
> > nameserver dnsroot
> > instead of
> > nameserver 198.41.0.4
>
> I am not aware of a file named "network.conf" in Debian.  Perhaps you
> are referring to the file named "resolv.conf".  This is a configuration
> file for the GNU LIBC resolver library.  According to the manual page
> resolv.conf(5), it is not possible to specify a nameserver IP address
> using a string like "dnsroot".

Sorry it is  /etc/network/interfaces (do no post late :) ) 
the resolv.conf will see the line dns-nameservers rootserver and transform it 
to numeric ip adress.

> As I understand it, your problem is that your ISP provides a crappy
> nameserver which you would like to override with another nameserver.
> What I would suggest is that you edit the hook script which is run after
> the network interface for your ISP connection is configured and which
> provides the nameserver address to resolvconf.  For example, suppose the
> dhclient3 program is used to configure interface eth0 on your system.
> dhclient3 obtains nameserver address 1.2.3.4 from your ISP's DHCP
> server.  You could customize the script
> /etc/dhcp3/dhclient-enter-hooks.d/resolvconf so that it substitutes
> another address before sending it to resolvconf.  This requires a bit of
> programming on your part, but I am afraid there is no other way to deal
> with special situations such as this.

I can try to do this, but I am not alone to have problem with this kind of 
stuff. Moreover IP are manually assigned (crappy crappy network). I am willing 
to made a patch :)

If think patching /etc/network/if-up.d/000resolvconf is the way to go:
-------------
--- 000resolvconf.old   2009-08-07 12:20:57.000000000 +0200
+++ 000resolvconf       2009-08-07 12:20:46.000000000 +0200
@@ -29,7 +29,8 @@
 "
 fi
 for NS in $IF_DNS_NAMESERVERS ; do
-       R="${R}nameserver $NS
+        NSsub=`echo $NS | sed s/dnsroot/198.41.0.4/g`
+       R="${R}nameserver $NSsub
 "
 done
 echo -n "$R" | /sbin/resolvconf -a "${IFACE}.${ADDRFAM}"
---------------

This patch use only the A server, improved version that i will send you will 
use A to J server

Bastien






More information about the Resolvconf-devel mailing list