Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]problem with resolv.conf
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
esmith
n00b
n00b


Joined: 21 Feb 2008
Posts: 3
Location: France

PostPosted: Thu Feb 21, 2008 7:09 pm    Post subject: [SOLVED]problem with resolv.conf Reply with quote

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 1:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
Stolz
Moderator
Moderator


Joined: 18 Oct 2003
Posts: 2795
Location: Valencia, Spain

PostPosted: Thu Feb 21, 2008 7:35 pm    Post subject: Reply with quote

Could you paste the full content of /etc/conf.d/net? and also the output of:
Code:
# ifconfig

_________________
Gentoosiasta
Back to top
View user's profile Send private message
esmith
n00b
n00b


Joined: 21 Feb 2008
Posts: 3
Location: France

PostPosted: Thu Feb 21, 2008 8:09 pm    Post subject: Reply with quote

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


Joined: 11 Feb 2008
Posts: 17

PostPosted: Fri Feb 22, 2008 1:52 am    Post subject: Reply with quote

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


Joined: 18 Sep 2003
Posts: 6100
Location: Blighty

PostPosted: Fri Feb 22, 2008 5:29 am    Post subject: Reply with quote

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


Joined: 21 Feb 2008
Posts: 3
Location: France

PostPosted: Fri Feb 22, 2008 1:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT - 5 Hours
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