View previous topic :: View next topic |
Author |
Message |
queen Veteran
Joined: 19 Jul 2005 Posts: 1642
|
Posted: Sun Dec 14, 2008 2:59 pm Post subject: [SOLVED] /etc/resolv.conf problem |
|
|
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 |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Sun Dec 14, 2008 4:06 pm Post subject: |
|
|
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 |
|
|
queen Veteran
Joined: 19 Jul 2005 Posts: 1642
|
Posted: Sun Dec 14, 2008 4:32 pm Post subject: |
|
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23062
|
Posted: Sun Dec 14, 2008 5:11 pm Post subject: |
|
|
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 |
|
|
queen Veteran
Joined: 19 Jul 2005 Posts: 1642
|
Posted: Sun Dec 14, 2008 5:41 pm Post subject: |
|
|
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 |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Sun Dec 14, 2008 5:48 pm Post subject: |
|
|
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 |
|
|
queen Veteran
Joined: 19 Jul 2005 Posts: 1642
|
Posted: Sun Dec 14, 2008 6:44 pm Post subject: |
|
|
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
The reason for my remark is because I have mtu as 2200 (wifi) in , but when I check ifconfig -a (after dhcpcd ), I see that mtu is 1500 and not 2200. Is there other file that overwrites ? |
|
Back to top |
|
|
Raniz l33t
Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Sun Dec 14, 2008 7:05 pm Post subject: |
|
|
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 |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
queen Veteran
Joined: 19 Jul 2005 Posts: 1642
|
Posted: Sun Dec 14, 2008 7:31 pm Post subject: |
|
|
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 |
|
|
queen Veteran
Joined: 19 Jul 2005 Posts: 1642
|
Posted: Mon Dec 15, 2008 6:37 am Post subject: |
|
|
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 |
|
|
|