| View previous topic :: View next topic |
| Author |
Message |
esmith n00b

Joined: 21 Feb 2008 Posts: 3 Location: France
|
Posted: Fri Feb 22, 2008 12:09 am Post subject: [SOLVED]problem with resolv.conf |
|
|
Hello, I'm a new user of Gentoo.
For the moment i've installed the system but there is a problem with my file /etc/resolv.conf.
In fact, i have a router with the adress 192.168.1.1 and i put it in resolv.conf : nameserver 192.168.1.1
And in my file /etc/conf.d/net i have the lines :
config_eth0=( "192.168.1.9 netmask 255.255.255.0 brd 192.168.1.255")
routes_eth0=("default via 192.168.1.1")
But when the system start there is something which rewrite my resolv.conf and so the line nameserver 192.168.1.1 disappear.
So i'm obliged to retype this line each reboot to connect to internet.
I think it's a problem with scrips maybe in /etc/init.d but i am no sure. _________________ sorry for errors of language, (and if you want you can tell me my errors to help me and i will correct them.)
Last edited by esmith on Fri Feb 22, 2008 6:15 pm; edited 1 time in total |
|
| Back to top |
|
 |
Stolz Moderator


Joined: 19 Oct 2003 Posts: 2900 Location: Valencia, Spain
|
Posted: Fri Feb 22, 2008 12:35 am Post subject: |
|
|
Could you paste the full content of /etc/conf.d/net? and also the output of:
|
|
| Back to top |
|
 |
esmith n00b

Joined: 21 Feb 2008 Posts: 3 Location: France
|
Posted: Fri Feb 22, 2008 1:09 am Post subject: |
|
|
thanks
output of ifconfig :
| Code: |
eth0 Link encap:Ethernet HWaddr 00:08:0D:0B:CF:DA
inet addr:192.168.1.9 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::208:dff:fe0b:cfda/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1799 (1.7 Kb) TX bytes:1606 (1.5 Kb)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
|
content of /etc/conf.d/net
| Code: |
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d. To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
dns_domain_lo="mydomain"
config_eth0=( "192.168.1.9 netmask 255.255.255.0 brd 192.168.1.255" )
routes_eth0=( "default via 192.168.1.1" )
|
I can ping all pcs in my network so : ping 192.168.1.4 succeeds for example.
However ping www.google.com is bad and the cause is my file is cleaned when i reboot.
So before the reboot i have in my resolv.conf this line that i put to have internet :
| Code: |
nameserver 192.168.1.1
|
After reboot the file resolv.conf has changed :
| Code: |
# Generated by net-srcipts for interface lo
domain mydomain
|
_________________ sorry for errors of language, (and if you want you can tell me my errors to help me and i will correct them.) |
|
| Back to top |
|
 |
kingc n00b

Joined: 11 Feb 2008 Posts: 21
|
Posted: Fri Feb 22, 2008 6:52 am Post subject: |
|
|
Since you have configured some part of dns:
| Code: | | dns_domain_lo="mydomain" |
your resolv.conf will be overwritten with the dns setup at boot.
add to your /etc/conf.d/net:
| Code: |
dns_servers=( "192.168.1.1" ) |
reboot / restart net and you should see the nameserver set up automatically in resolve.conf. |
|
| Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6271 Location: Blighty
|
Posted: Fri Feb 22, 2008 10:29 am Post subject: |
|
|
Or just remove the dns_domain_lo line as you probably don't need it. _________________ When baselayout tells you to update config files or things break WE REALLY DO MEAN IT
Please add SOLVED to the thread title if your issue has been
Strip comments from configs please |
|
| Back to top |
|
 |
esmith n00b

Joined: 21 Feb 2008 Posts: 3 Location: France
|
Posted: Fri Feb 22, 2008 6:15 pm Post subject: |
|
|
thanks a lot UberLord and kingc, the problem was the line dns_domain_lo="mydomain"  _________________ sorry for errors of language, (and if you want you can tell me my errors to help me and i will correct them.) |
|
| Back to top |
|
 |
|