View previous topic :: View next topic |
Author |
Message |
joeklow n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/19275002184d814fddc6a4b.png)
Joined: 23 Jan 2011 Posts: 46
|
Posted: Wed Apr 13, 2011 9:02 pm Post subject: resolv.conf question | hooking into /etc/init.d/net script |
|
|
Hi all.
I have multiple network interfaces and a ton of mess around them including load balancing etc.
When interface X goes down via /etc/init.d/netX stop, it automatically removes all entries from resolv.conf, including those I added manually.
When DHCP starts for netX, it does the same (unfortunately netX has to get dynamic DNS via DHCP, so can't just add static route via dns_servers_netX).
Where and when does /etc/init.d/network changes /etc/resolv.conf? I need to put my own hook there, since it is also planned to use hacked udhcp(d) instead of dhcpd to keep interface IPs somewhere in /var/dhcp/$interface_ip_config. (by the way, where's initscripts dhcp module is stored? - need to modify it too)
Or, how to enable this functionality of resolvconf(5)?
NAME
resolvconf — a framework for managing multiple DNS configurations
SYNOPSIS
resolvconf -I
resolvconf [-m metric] [-p] -a interface <file
resolvconf [-f] -d interface
resolvconf -il pattern
resolvconf -u
Quote: |
resolvconf solves this by letting the daemon send their resolv.conf(5) file to resolvconf via stdin(3) with the argument -a
interface instead of the filesystem. resolvconf then updates /etc/resolv.conf as it thinks best. When a local resolver
other than libc is installed, such as dnsmasq( or named( , then resolvconf will supply files that the resolver should be
configured to include.
resolvconf can mark an interfaces resolv.conf as private. This means that the name servers listed in that resolv.conf are
only used for queries against the domain/search listed in the same file. This only works when a local resolver other than
libc is installed. See resolvconf.conf(5) for how to configure resolvconf to use a local name server.
|
I need multiple resolv.conf's for all interfaces of /etc/conf.d/net.. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Raptor85 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 29 Dec 2007 Posts: 208
|
Posted: Thu Apr 14, 2011 1:46 am Post subject: |
|
|
add your entries into /etc/resolv.conf.head instead. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
djinnZ Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/3978748614ef08bfa7f764.jpg)
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Thu Apr 14, 2011 8:44 am Post subject: |
|
|
or better you can configure udev for mirror the NICs as different devices (only if you have multiple network to connect, as in a laptop) and use the ifup_*/ifdown_* function in /etc/conf.d/net.* (where * is the network interface) to set up resolv.conf and/or resolv.conf.head. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|