Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
changing DNS addresses
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
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 7:47 pm    Post subject: changing DNS addresses Reply with quote

how do i go about changing my DNS addressses that are listed in /etc/resolv.conf
permenantly ??
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Fri Jun 18, 2010 8:07 pm    Post subject: Reply with quote

Assuming you are using DHCP, add nodns to the dhcp_eth0 variable in /etc/conf.d/net.
Back to top
View user's profile Send private message
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 8:13 pm    Post subject: Reply with quote

i tried that

i put this in my /etc/conf.d/net file
dhcp_eth0="nodns"

and changed the nameserver ips in /etc/resolv.conf file
rebooted and i had no internet connection
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Fri Jun 18, 2010 8:23 pm    Post subject: Reply with quote

You had no connection, or was your /etc/resolv.conf file empty?
Back to top
View user's profile Send private message
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 8:31 pm    Post subject: Reply with quote

it was empty
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Fri Jun 18, 2010 8:40 pm    Post subject: Reply with quote

Maybe your DHCP client wipes /etc/resolv.conf when it shuts down. Try editing the file after you start eth0 using nodns.
Back to top
View user's profile Send private message
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 8:48 pm    Post subject: Reply with quote

that seems to work, /etc/resolv.conf did not get cleared.
so how do i make the permenant??
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Fri Jun 18, 2010 8:52 pm    Post subject: Reply with quote

If you restart it now that it works does it get wiped again? It shouldn't...
Back to top
View user's profile Send private message
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 8:59 pm    Post subject: Reply with quote

it wiped it again.

when i did what u said previous, all i did was logout then login again.
Back to top
View user's profile Send private message
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 9:08 pm    Post subject: Reply with quote

i tried this, added the nodns /etc/conf.d/net and changing the ips in /etc/resolv.conf and ifconfig eth0 down , ifconfig eth0 up
and it worked, but when i restarted the /etc/resolv.conf file got wiped.
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Fri Jun 18, 2010 9:45 pm    Post subject: Reply with quote

You probably have net-dns/openresolv installed. It is meant to set up /etc/resolv.conf and always runs if the /sbin/resolvconf file exists. So, you can either try 1) unmerge the net-dns/openresolv package or 2) you could set up your DNS in /etc/conf.d/net.

For the first option, make sure that there is no resolvconf in your USE flags and then emerge -C net-dns/openresolv. For the second option, add a line similar to dns_servers_eth0="192.168.1.1 192.168.1.2" to your /etc/conf.d/net file.
Back to top
View user's profile Send private message
grimx
n00b
n00b


Joined: 15 Jun 2010
Posts: 63

PostPosted: Fri Jun 18, 2010 10:14 pm    Post subject: Reply with quote

ok i did your second option and rebooted and it seems to work.
so with this option it in effect bypasses /etc/resolv.conf ??
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Sat Jun 19, 2010 10:50 am    Post subject: Reply with quote

No, it writes /etc/resolv.conf every time you start eth0, using those values. You have net-dns/openresolv installed, which provides /sbin/resolvconf. During the shutdown of eth0, if the file /sbin/resolvconf exists it gets called with the -d option--which deletes the nameserver records in /etc/resolv.conf. So, you have to either get rid of the /sbin/resolvconf file (unmerge net-dns/openresolv) so it doesn't wipe out /etc/resolv.conf or use net-dns/openresolv (via /etc/conf.d/net or /etc/resolvconf.conf) to set up your /etc/resolv.conf...
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