Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] DHCPCD and nameserver
Date: Sat, 21 Aug 2010 22:25:28
Message-Id: 4C705213.4050905@gmail.com
In Reply to: Re: [gentoo-user] DHCPCD and nameserver by Marc Joliet
1 Marc Joliet wrote:
2 > Am Sat, 21 Aug 2010 09:15:26 +0059
3 > schrieb Jorge Almeida<jjalmeida@×××××.com>:
4 >
5 > [...]
6 >
7 >> I don't know about dhcpcd, but I'm using dhclient, and it works like this:
8 >> $cat /etc/resolv.conf
9 >> config_eth0=("dhcp")
10 >> modules_eth0=("dhclient")
11 >> dhcp_eth0="nodns"
12 >>
13 >> I'm not sure the last line is necessary.
14 >> Then:
15 >>
16 >> $ cat /etc/dhcp/dhclient.conf
17 >> append option domain-name-servers 127.0.0.1
18 >>
19 >> Substitute 127.0.0.1 by 8.8.8.8
20 >>
21 > With dhcpcd you can do something similar. When I was setting up dnsmasq on my
22 > system I found out you can create hooks for dhcpcd; for instance,
23 > in /etc/dhcpcd.enter-hook I have (well, now "had"):
24 >
25 > # Prepend localhost to the list of DNS servers
26 > new_domain_name_servers="127.0.0.1 ${new_domain_name_servers}"
27 >
28 > The resulting resolv.conf:
29 >
30 > marcec marcec # cat /etc/resolv.conf
31 > # Generated by dhcpcd from eth0
32 > # /etc/resolv.conf.head can replace this line
33 > search huntemann.uni-oldenburg.de
34 > nameserver 127.0.0.1
35 > nameserver 192.168.0.250
36 > # /etc/resolv.conf.tail can replace this line
37 >
38 > However, the comments in resolv.conf indicate you you can create one or both of
39 > /etc/resolv.conf.{head,tail}, which will be merged into /etc/resolv.conf
40 > automatically! The resulting resolv.conf:
41 >
42 > marcec marcec # cat /etc/resolv.conf
43 > # Generated by dhcpcd from eth0
44 > # force localhost as first nameserver
45 > nameserver 127.0.0.1
46 > search huntemann.uni-oldenburg.de
47 > nameserver 192.168.0.250
48 > # /etc/resolv.conf.tail can replace this line
49 >
50 > So both methods are slighly different. I think I'll stick with the latter now,
51 > as I think it's more correct. However, I'm not sure whether this works with
52 > other DHCP clients or just for dhcpcd.
53 >
54 >
55 >> HTH
56 >>
57 >> Jorge
58 >>
59 > HTH
60 > --
61 > Marc Joliet
62 > --
63 > Lt. Frank Drebin: "It's true what they say: cops and women don't mix. Like
64 > eating a spoonful of Drāno; sure, it'll clean you out, but it'll leave you
65 > hollow inside."
66 >
67
68 I read about the head/tail files but wasn't sure what they did or how it
69 worked. I need new glasses so I can see better. I spend more time
70 trying to read than being able to understand what I read. -_- <<==
71 That would be eyes closed.
72
73 I guess I could have created a head file and just put my prefs on top.
74 Thing is, I just removed the overlays so now I don't even need this.
75 lol Then again, those are faster than my ISPs servers. Still better off.
76
77 Thanks for the info. I learned something.
78
79 Dale
80
81 :-) :-)