# [solved] can't resolve dns anymore

## onineko

Hello!

ok, i'm a bit stumped right now:

after i had (with some problems) at long last updated my gentoo box, i had the occasional problem because the /etc/resolv.conf seems to be overwritten (i don't know by what) and loses the nameservers. So when i noticed that my box couldn't resolve again, i didn't think much of it, nano /etc/resolv.conf, yeah no nameservers to be seen, put the lines in again...and the trouble didn't stop!

the box is a small server on which runs my mailstuff primarily (cyrus, squirrel, fetchmail..), also it works as a router (one eth goes adsl, the other gets the switch for the homeusers).

yesterday i was poking it a bit, emerging php a few times because i needed this or that module for my little cms-testing, but obviously at this time, dns-resolving was no problem at all.

where can i look, except /etc/resolv.conf, to find out, what is stopping me from resolving names?Last edited by onineko on Wed Mar 25, 2009 5:17 pm; edited 3 times in total

----------

## mamac

Hi,

Can you post your /etc/conf.d/net?

You can check out http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2 , it might help.

----------

## onineko

config_eth0=( "192.168.0.1 netmask 255.255.255.0" )

config_eth1=( "adsl" )

i'm not 100% sure, but i think it's been like that for quite some time (including yesteray)..

thx

----------

## mamac

Not sure but I'd try to add

```

routes_eth0=( "default via 192.168.0.XXX" )

```

----------

## onineko

thank you, what would i insert for the xxx?

edit:

well, i used the default routes_eth0=( "default via 192.168.0.1" ), although i think i remember that this was removed by me at some point in time, because it was interfering.

the box uses ppp to connect to the isp and the ppp0 connection is the default route. also, the internet-connection per se is not a problam, when i say ping <ip-adress of google.de> it works, ping www.google.com gives me the unknown host message..

are there any log where i could find out, whats going down? it is just so weird, that he doesn't use the dns-servers from resolv.conf. do i have restart any daemons and is it possible to do that without the risk of the box being unreachable after? because the server is not at my home, but at my mother's house...

thx for any hints here..^^;

----------

## mamac

then I think the problem is more with you ppp interface. Which software do you use to dial?

----------

## TheAbu

You might want to try and add this in your /etc/conf.d/net

dns_servers_eth0=("192.168.88.1") 

Just replace my router by your dns server  :Smile: 

You can also put:

nameserver 192.168.88.1

in /etc/resolv.conf but it's better to do it the first way to avoid it being erased 

at boot time.

----------

## onineko

mamac: 

i'm using ppp to dial. (i think that's the name, the config is after all in /etc/ppp/)

i'm not sure how it can be a problem of my ppp-prog? where might be log-messages that give a hint in that direction?

the config: 

ETH='eth1'

USER='myusernameattheisp'

DEMAND=no

DNSTYPE=SPECIFY

PEERDNS=no

DNS1=213.191.92.86

DNS2=62.109.123.7

DEFAULTROUTE=yes

rest ist standard, also, it is able to connect to the internet, else i wouldn't be able to ssh to it...where could i find any clues, log or otherwise, what he is trying to do and where he's going wrong when he wants to resolve?

TheAbu: thank you for the hint! i put the line in the file, but so far there is no effect. i'm dreading i'll have to restart the network-interface for the change to take effect, but i guess there's no other way?

also, the dns-servers are already added to /etc/resolv.conf. but i still can't resolve names... 

if anyone has an idea, where i could see, whats going on, or even better, what is a probable cause, that'd be great ^^

----------

## mamac

 *onineko wrote:*   

> i'm not sure how it can be a problem of my ppp-prog? where might be log-messages that give a hint in that direction?

 

Because I suspect ppp doesn't right the proper dns config (for some reason) when establishing the connection, hence the system can't resolv. I compare this with wvdial behavior, thinking...

----------

## mamac

Maybe use option usepeerdns, from man pppd:

 *Quote:*   

> 
> 
> usepeerdns 
> 
> Ask the peer for up to 2 DNS server addresses. The addresses supplied by the peer (if any) are passed to the /etc/ppp/ip-up script in the environment variables DNS1 and DNS2, and the environment variable USEPEERDNS will be set to 1. In addition, pppd will create an /var/run/ppp/resolv.conf file containing one or two nameserver lines with the address(es) supplied by the peer. 
> ...

 

Then you shouldn't need to set your DNS addresses manually in the ppp config file.

----------

## onineko

ok, i found the "problem" (or at least i think so ^^)

 for some odd, otherwordly reason, dhcpd (it wasn't even configured, no clue why it was even emerged..) was running and seemed to be overwriting the file at more or less randomized (and quite short) intervals of time. so, i enter the resolv.conf, the servers are there, i try to resolv something, somehow dhcpd takes that as incentive to overwrite the file. (although seeing how i rechecked the resolv.conf numerous times, all the while the namerserver-lines being there, i think it was a cooperation with ppp and/or the line in the /etc/conf.d/net.)

but i got rid of pppd's pesky desire to do ANYthing that has to do with dns, so the front is clear there too, for now. dito the /etc/conf.d/net

i'll keep an eye on it, but in the hopeful case of this having been mostly a pilot error i want to say thank you, again, for the helpful hints! you rock! =)

----------

## mamac

Good!

You just have to edit your first message and add [SOLVED] in the title  :Wink: 

----------

## onineko

and hello again! ^_^;;

well, the dhcpcd is still overwriting my resolv.conf at random intervals.

my current /etc/conf.d/net:

config_eth0=( "192.168.0.1 netmask 255.255.255.0" )

dhcp_eth0=( "nodns" )

dhcp_eth0="nodns"

is it save to say modules=( "!dhcpcd" ) ?

or even better, is it save, to unmerge the dhcpcd?

is it possible, to check, if pppd uses for some reason dhcpcd? I mean, i`m pretty sure he doesn`t, but as i said, the box is not at my place, so if it couldn`t reconnect to the isp at the daily reconnect, that would really suck =)

as mentioned already, i told pppd to leave the dns of the system alone (pppoe.conf says on that note DNSTYPE=NOCHANGE and PEERDNS=NO). also, i killed the dhcpcd, i`m quite surprised that it was started again...?

----------

## mamac

I would try to unmerge dhcpcd as you run on static ip. But I don't know if pppd needs dhcpcd to get an ip from your ISP.

----------

## onineko

thanks, that what i did...and luckily ppp still working, so have a nice one, everyone =)

----------

