Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] /etc/resolv.conf problem
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
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Sun Dec 14, 2008 2:59 pm    Post subject: [SOLVED] /etc/resolv.conf problem Reply with quote

Hello Everyone

Since yesterday I have a problem that the contents of /etc/resolv.conf is erased and therefore I am dissconnected from the internet. I have a modem-router siemens and I connect via wifi.

Here is how it looks like before
Code:
more /etc/resolv.conf
# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line

and after copying a backup file I get this
Code:
more /etc/resolv.conf
# Generated by dhcpcd from eth2
# /etc/resolv.conf.head can replace this line
search siemens
nameserver 10.0.0.138
# /etc/resolv.conf.tail can replace this line


First, why it is happening. 2nd, how can I solve this problem. I haven't done anything special. my mtu is 1500 for wifi, the same as the router.

The content of the file is erased every few minutes.


Last edited by queen on Mon Dec 15, 2008 6:37 am; edited 1 time in total
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Sun Dec 14, 2008 4:06 pm    Post subject: Reply with quote

If it happens every few minutes it's probably when the lease refreshes since your dhcp client will rewrite resolv.conf with the information from the previous dhcp request.

You can solve this in two ways, either you check why your router isn't giving you any DNS information or you tell your dhcp client to not overwrite resolv.conf and use your backup. The first solution is of course the best one.
Back to top
View user's profile Send private message
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Sun Dec 14, 2008 4:32 pm    Post subject: Reply with quote

Raniz wrote:
If it happens every few minutes it's probably when the lease refreshes since your dhcp client will rewrite resolv.conf with the information from the previous dhcp request.

You can solve this in two ways, either you check why your router isn't giving you any DNS information or you tell your dhcp client to not overwrite resolv.conf and use your backup. The first solution is of course the best one.


Until I figure out why the router isn't giving dns, how do I arrange the 2nd part?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23062

PostPosted: Sun Dec 14, 2008 5:11 pm    Post subject: Reply with quote

Setting the nodns option for that interface should suppress changes to /etc/resolv.conf. See /etc/conf.d/net.example for details.
Back to top
View user's profile Send private message
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Sun Dec 14, 2008 5:41 pm    Post subject: Reply with quote

Hu wrote:
Setting the nodns option for that interface should suppress changes to /etc/resolv.conf. See /etc/conf.d/net.example for details.


I had nodns set.
So, the problem is probably in other place.
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Sun Dec 14, 2008 5:48 pm    Post subject: Reply with quote

You can try forcing DNS settings for that interface.
Code:
dns_domain_eth0="your.domain"
dns_servers_eth0="192.168.0.2 192.168.0.3"
dns_search_eth0="this.domain that.domain"
Back to top
View user's profile Send private message
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Sun Dec 14, 2008 6:44 pm    Post subject: Reply with quote

Raniz wrote:
You can try forcing DNS settings for that interface.
Code:
dns_domain_eth0="your.domain"
dns_servers_eth0="192.168.0.2 192.168.0.3"
dns_search_eth0="this.domain that.domain"


will try this option. But from what I see it disregards
Code:
/etc/conf.d/net

The reason for my remark is because I have mtu as 2200 (wifi) in
Code:
/etc/conf.d/net
, but when I check ifconfig -a (after dhcpcd ), I see that mtu is 1500 and not 2200. Is there other file that overwrites
Code:
/etc/conf.d/net
?
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Sun Dec 14, 2008 7:05 pm    Post subject: Reply with quote

MTU is negotiated when establishing the connection with the other end. If the other end cannot handle an MTU of 2200 they will negotiate another MTU (most likely 1500 since that's the default).
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sun Dec 14, 2008 7:26 pm    Post subject: Reply with quote

You didn't say which dhcpcd version has the error. Try dhcpcd-4.0.7
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Sun Dec 14, 2008 7:31 pm    Post subject: Reply with quote

UberLord wrote:
You didn't say which dhcpcd version has the error. Try dhcpcd-4.0.7


[I] net-misc/dhcpcd
Available versions: 3.0.16-r1 3.1.5-r1 3.2.3 ~4.0.0 4.0.1-r1 4.0.2 ~4.0.3 ~4.0.4 ~4.0.5 ~4.0.6 ~4.0.7 [M]~4.99.5 [M]~4.99.6 {compat vram zeroconf}
Installed versions: 4.0.2(08:21:05 PM 10/12/2008)(compat zeroconf)

will try 4.0.7. Appears unstable in my portage, but I will upgrade.
Back to top
View user's profile Send private message
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Mon Dec 15, 2008 6:37 am    Post subject: Reply with quote

The problem was solved. I discovered there was from time to time a low signal from the router which caused lots of connections, disconnections.
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