View previous topic :: View next topic |
Author |
Message |
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 7:47 pm Post subject: changing DNS addresses |
|
|
how do i go about changing my DNS addressses that are listed in /etc/resolv.conf
permenantly ?? |
|
Back to top |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Fri Jun 18, 2010 8:07 pm Post subject: |
|
|
Assuming you are using DHCP, add nodns to the dhcp_eth0 variable in /etc/conf.d/net. |
|
Back to top |
|
|
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 8:13 pm Post subject: |
|
|
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 |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Fri Jun 18, 2010 8:23 pm Post subject: |
|
|
You had no connection, or was your /etc/resolv.conf file empty? |
|
Back to top |
|
|
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 8:31 pm Post subject: |
|
|
it was empty |
|
Back to top |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Fri Jun 18, 2010 8:40 pm Post subject: |
|
|
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 |
|
|
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 8:48 pm Post subject: |
|
|
that seems to work, /etc/resolv.conf did not get cleared.
so how do i make the permenant?? |
|
Back to top |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Fri Jun 18, 2010 8:52 pm Post subject: |
|
|
If you restart it now that it works does it get wiped again? It shouldn't... |
|
Back to top |
|
|
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 8:59 pm Post subject: |
|
|
it wiped it again.
when i did what u said previous, all i did was logout then login again. |
|
Back to top |
|
|
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 9:08 pm Post subject: |
|
|
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 |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Fri Jun 18, 2010 9:45 pm Post subject: |
|
|
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 |
|
|
grimx n00b
Joined: 15 Jun 2010 Posts: 63
|
Posted: Fri Jun 18, 2010 10:14 pm Post subject: |
|
|
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 |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Sat Jun 19, 2010 10:50 am Post subject: |
|
|
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 |
|
|
|