Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
resolv.conf question | hooking into /etc/init.d/net script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
joeklow
n00b
n00b


Joined: 23 Jan 2011
Posts: 46

PostPosted: Wed Apr 13, 2011 9:02 pm    Post subject: resolv.conf question | hooking into /etc/init.d/net script Reply with quote

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(8) or named(8), 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
View user's profile Send private message
Raptor85
Apprentice
Apprentice


Joined: 29 Dec 2007
Posts: 208

PostPosted: Thu Apr 14, 2011 1:46 am    Post subject: Reply with quote

add your entries into /etc/resolv.conf.head instead.
Back to top
View user's profile Send private message
djinnZ
Advocate
Advocate


Joined: 02 Nov 2006
Posts: 4831
Location: somewhere in L.O.S.

PostPosted: Thu Apr 14, 2011 8:44 am    Post subject: Reply with quote

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:wink:
mala tempora currunt...mater stultorum semper pregna est :evil:
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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