Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
force localhost into resolv.conf ... how?
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
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Tue Jun 26, 2007 12:59 pm    Post subject: force localhost into resolv.conf ... how? Reply with quote

I'm stuck on dial up for the next couple of months. Having
a local caching nameserver speeds things up a little bit.

But I find that whenever I connect via dialup my /etc/resolv.conf
is overwritten and the line

Code:
nameserver 127.0.0.1


is removed. If I add it again everything works fine (I save about
a quarter second for almost *every* lookup -- hey, it adds
up :) )

I added

Code:
dhcp_eth0="nodns"
dhcp_eth1="nodns"


but it had no effect. (Obviously, I want nameservers assigned
by the dialup connection, but I want localhost to remain the
first nameserver ...)


Anybody know how to force my local nameserver line to remain
in resolv.conf? TIA,
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
Dizzutch
Guru
Guru


Joined: 09 Nov 2004
Posts: 463
Location: Worcester, MA

PostPosted: Tue Jun 26, 2007 1:05 pm    Post subject: Reply with quote

a little trick that might work, is that once you have your nameservers from the DHCP server, you add the localhost ot your /etc/resolv.conf and then add
Code:
dhcpcd_eth0="-R"
to your /etc/conf.d/net file, which tells dhcpcd to not overwrite your /etc/resolv.conf file. It's a workaround, however if your name servers change you have to remove the line, and release/renew...
_dizz
_________________
Help the confused! Adopt an unanswered post!
prepend [solved] to your post title when you feel your issue is resolved.
Worcester Judo
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Tue Jun 26, 2007 2:10 pm    Post subject: Reply with quote

thanks for the suggestion but it has no effect ...

It is the dial up connection process that is overwriting resolv.conf;
I need a way to prepend "nameserver 127.0.0.1" to resolv.conf
*after* ppp0 comes up ...
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
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