Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] Override DHCP-provided DNS Dale <rdalek1967@×××××.com>