View previous topic :: View next topic |
Author |
Message |
gmtongar Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/HalfLife/Half_Life_-_Gman.gif)
Joined: 21 Mar 2004 Posts: 224 Location: Kristiansand, Norway
|
Posted: Wed Apr 05, 2006 11:39 pm Post subject: Prevent router to overwrite nameserver in resolv.conf |
|
|
Hi everyone
I've set up DNSMASQ on my gentoo box, my server.
The thing is, my router also function as a DNS+DHCP server. When I boot my other boxes running gentoo, my resolv.conf gets overwritten.
How can I prevent that from happening?
Now I have to manually update resolv.conf (adress 192.168.0.60), istead of 192.168.0.1, which
the router sets it to be (a long drown-out sentence, I know)
Any hint on how to solve this would be most welcome!
thanks |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
SlightlyMiffed n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 12 Jan 2006 Posts: 5 Location: UK
|
Posted: Thu Apr 06, 2006 12:04 am Post subject: |
|
|
I think you need to set the "-R" option for dhcpcd.
Quote: | man dhcpcd
...
-R Prevents dhcpcd from replacing existing <etcDir>/resolv.conf file.
...
|
You set this in /etc/conf.d/net, something like:
dhcpcd_eth0="-R"
HTH! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
wafox n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Mar 2006 Posts: 29
|
Posted: Thu Apr 06, 2006 3:23 am Post subject: huh.. |
|
|
I'm getting a similar problem. My resolv.conf file gets nuked every time I boot up or bring my eth0 interface up.
Contents of my /etc/conf.d/domainname file:
Code: |
# /etc/conf.d/domainname
# When setting up resolv.conf, what should take precedence?
# 0 = let dhcp/whatever override DNSDOMAIN
# 1 = override dhcp/whatever with DNSDOMAIN
OVERRIDE=1
DNSDOMAIN="stfu.lan"
NISDOMAIN=""
|
Contents of my /etc/conf.d/net file:
Code: |
dhcpcd_eth0="-R"
config_eth0=( "dhcp")
|
but my /etc/resolv.conf files always get an overwrite and looks like this:
Code: |
# generated automatically by net-scripts
domain hawaii.rr.com
nameserver 192.168.0.118
|
The nameserver is set correctly by DHCP - this box is my nameserver and the dhcp server sets me to this static IP address. But this overwriting of the resolv.conf file is driving me nuts. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gmtongar Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/HalfLife/Half_Life_-_Gman.gif)
Joined: 21 Mar 2004 Posts: 224 Location: Kristiansand, Norway
|
Posted: Thu Apr 06, 2006 7:43 am Post subject: |
|
|
Quote: | You set this in /etc/conf.d/net, something like:
dhcpcd_eth0="-R"
|
Thanks. Worked like magic beans...
Could you, if it's not too much to ask, give me a hint on how I could prevent my gentoo boxes
from using my router as DHCP, and instead only use my gentoo server as DHCP (I got DNSMASQ
installed and working, it seems)?
But thanks anyway... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gmtongar Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/HalfLife/Half_Life_-_Gman.gif)
Joined: 21 Mar 2004 Posts: 224 Location: Kristiansand, Norway
|
Posted: Thu Apr 06, 2006 10:06 am Post subject: |
|
|
right
you may now stop laughing... ![Rolling Eyes :roll:](images/smiles/icon_rolleyes.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lmcogs Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 03 Apr 2005 Posts: 340
|
Posted: Thu May 04, 2006 6:57 pm Post subject: |
|
|
UberLord wrote: | You have to stop your router serving DHCP ![Smile :)](images/smiles/icon_smile.gif) |
Now how do you do that and yes as far as I am know I try to update the system, after updates.
dhcpcd_lan="-R" is not working for me. Need more clarity. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lmcogs Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 03 Apr 2005 Posts: 340
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|