Gentoo Archives: gentoo-user

From: YoYo Siska <yoyo@××××××.sk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Override DHCP-provided DNS
Date: Wed, 15 Jun 2011 14:29:30
Message-Id: 20110615142725.GA20949@ksp.sk
In Reply to: [gentoo-user] Override DHCP-provided DNS by Florian Philipp
1 On Wed, Jun 15, 2011 at 04:07:43PM +0200, Florian Philipp wrote:
2 > Hello list!
3 >
4 > for some wireless access points, I want to get an IP via DHCP but not
5 > use the provided DNS-server (I use an openvpn setup with its own DNS
6 > server, domain name, etc.).
7 >
8 > In /usr/share/doc/openrc-0.8.2-r1/net.example it reads:
9 > # Setting name/domain server causes /etc/resolv.conf to be overwritten
10 > # Note that if DHCP is used, and you want this to take precedence then
11 > # please put -R in your dhcpcd options
12 >
13 > But dhcpcd does not seem to have a -R option. It does have a --static
14 > option, though. While this is good enough for simply setting the DNS
15 > server, it does not seem to allow specifying domain names or
16 > search-domains (at least it is not shown in the man-page).
17 >
18 > Please tell me what the proper way is and whether the mention of "-R" is
19 > a documentation bug.
20 >
21 > Thanks in advance,
22 > Florian Philipp
23
24 from the man page, this seems to do what you want
25 (never tried, i use dhclient and its /etc/dhcp/dhclient.conf):
26
27 -C, --nohook script
28 Don't run this hook script. Matches full name, or prefixed with 2 numbers optionally ending with .sh.
29
30 So to stop dhcpcd from touching your DNS or MTU settings you would do:-
31 dhcpcd -C resolv.conf -C mtu eth0
32
33
34 yoyo

Replies

Subject Author
Re: [gentoo-user] Override DHCP-provided DNS "Juan Diego Tascón" <juantascon@×××××.com>