Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Prevent router to overwrite nameserver in resolv.conf
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
gmtongar
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 224
Location: Kristiansand, Norway

PostPosted: Wed Apr 05, 2006 11:39 pm    Post subject: Prevent router to overwrite nameserver in resolv.conf Reply with quote

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
View user's profile Send private message
SlightlyMiffed
n00b
n00b


Joined: 12 Jan 2006
Posts: 5
Location: UK

PostPosted: Thu Apr 06, 2006 12:04 am    Post subject: Reply with quote

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
View user's profile Send private message
wafox
n00b
n00b


Joined: 30 Mar 2006
Posts: 29

PostPosted: Thu Apr 06, 2006 3:23 am    Post subject: huh.. Reply with quote

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
View user's profile Send private message
gmtongar
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 224
Location: Kristiansand, Norway

PostPosted: Thu Apr 06, 2006 7:43 am    Post subject: Reply with quote

Quote:
You set this in /etc/conf.d/net, something like:

dhcpcd_eth0="-R"

Thanks. Worked like magic beans... :wink:

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Apr 06, 2006 9:38 am    Post subject: Reply with quote

You have to stop your router serving DHCP :)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
gmtongar
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 224
Location: Kristiansand, Norway

PostPosted: Thu Apr 06, 2006 10:06 am    Post subject: Reply with quote

right :oops:

you may now stop laughing... :roll:
Back to top
View user's profile Send private message
lmcogs
Guru
Guru


Joined: 03 Apr 2005
Posts: 340

PostPosted: Thu May 04, 2006 6:57 pm    Post subject: Reply with quote

UberLord wrote:
You have to stop your router serving DHCP :)


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
View user's profile Send private message
lmcogs
Guru
Guru


Joined: 03 Apr 2005
Posts: 340

PostPosted: Wed May 10, 2006 11:14 pm    Post subject: Reply with quote

Hi

As well as dhcpcd_lan="-R" I found this

https://forums.gentoo.org/viewtopic-t-454524-start-25-postdays-0-postorder-asc-highlight-resolv+conf.html

and changing my domainname as given the system now starts without changing the resolv.conf file
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