# Internet Completely Gone

## baigsabeeh

I recently upgraded to DHCPCD 3.0.8-r1 and now my internet is gone.

I've tried ifconfig to check my interfaces and they are all configured fine.  I've checked using ping to google and it always gives me unknown host.  I also checked the firewire ehternet module to make sure it wasn't loaded.

I'm at a loss here.  

Anybody have any ideas?  Do you need more information?

----------

## erik258

try to ping a known publicly accessible ip, say 66.41.120.249 (that's mine)

if you get responses, the problem is restricted to nameserver settings.  

have you tried running dhcpcd on the console and seeing what it said?  

do you need to etc-update ?

----------

## baigsabeeh

Pinging the IP you posted works.  So, I guess it's a problem with nameserver settings.  What do I need to do to fix those?  I've never encountered this before.

----------

## erik258

the settings are in /etc/resolv.conf 

what's in that file?  anything?

----------

## baigsabeeh

It has only one line.

```
domain home
```

I never edited this file, so I don't even know if that's supposed to be there, but I'm guessing not.

----------

## erik258

it has to be there, baigsabeeh.  if it isn't your computer won't know which ip the namserver is.  mine looks like this

```
nameserver 192.168.1.1
```

of course, that won't work for you.  do you know the source of your name resolution?

----------

## jadfw007

I can ping/browse to anything using an IP address, but DNS doesn't work. I created /etc/resolv.conf and added a nameserver XXX.XXX.XXX.XXX line to it.

Problem is, this file gets deleted every time the interface starts! I did find a /etc/resolvconf/interfaces/ra0 file (I'm connecting via RT2500 wireless) which had a nameserver line already in it with the correct IP address, but this didn't seem to be doing the trick either.

----------

## baigsabeeh

 *erik258 wrote:*   

> it has to be there, baigsabeeh.  if it isn't your computer won't know which ip the namserver is.  mine looks like this
> 
> ```
> nameserver 192.168.1.1
> ```
> ...

 

Mine is 192.168.2.1.  I'll add this and give it a go.

----------

## baigsabeeh

That did it, thank you, I really appreiciate this.

----------

## jadfw007

My apologies for crashing your thread, but it's likely we're having the exact same problem. Check for the presence of your resolv.conf file after you restart the interface and let me know if yours is getting deleted too.

I also found the file /etc/resolv.conf.ra0.sv which also seems to be getting deleted or re-generated every time the interface starts. It's very confusing and extremely frustrating. Any help would be greatly appreciated.

----------

## baigsabeeh

Which DHCPCD are you using?  It may have something to do with that.

----------

## jadfw007

2.0.8-r3

----------

## baigsabeeh

I'm using 3.0.8 and I don't know if that might have something to do with it.

----------

## erik258

the network device doesn't need to be restarted for changes to resolv.conf to take effect.  in fact, dhcp will overwrite resov.conf so if you run that it will destroy your changes.  

instead, run dhcp and then edit /etc/resolv.conf.[/list]

----------

## jadfw007

I'll emerge -uD'ing dhpcd and see if that helps. In the meantime, here is my /etc/conf.d/net

```
routes_ra0=( "default gw 192.168.11.1" )

dns_servers_ra0=( "192.168.11.1" )

```

and my /etc/conf.d/wireless

```
iwpriv_00160114240E=(

        "set AuthMode=WPAPSK"

        "set EncrypType=AES"      # You may need to put AES here

        "set WPAPSK=my_ascii_password"

)

key_00160114240E="s:my_ascii_password enc open"

config_00160114240E=( "dhcp" )

dhcpcd_00160114240E="-t 10"

routes_00160114240E=()

fallback_00160114240E=()
```

----------

## Underdone

 *baigsabeeh wrote:*   

> I'm using 3.0.8 and I don't know if that might have something to do with it.

  It wouldn't suprise me if that was the problem.

If possible try to boot from the livecd and emerge dhcpcd, and copy the resolv.conf file while your at it. (Assuming internet works with the livecd)

----------

## erik258

that's not going to do any good; the nameserver line is already known.

----------

## jadfw007

 *erik258 wrote:*   

> the network device doesn't need to be restarted for changes to resolv.conf to take effect.  in fact, dhcp will overwrite resov.conf so if you run that it will destroy your changes.  
> 
> instead, run dhcp and then edit /etc/resolv.conf.[/list]

 

That works, but only until I reboot. Then dhcp re-starts and deletes my file.

----------

## erik258

i assume it used to work, so i am left with no option but to blame your new version of dhcpcd.  downgrade?

----------

## jadfw007

 *erik258 wrote:*   

> i assume it used to work, so i am left with no option but to blame your new version of dhcpcd.  downgrade?

 

Actually this is a fresh install. With what apparently is an older version of dhcpd out of the box. I haven't emerge -uD'ed it yet. That's next on my list to try. I'll post the results after I do it.

----------

## jadfw007

Well I emerged dhcpcd and my resolv.conf file is still getting cleared out every time I reboot. It's not getting deleted anymore since I ran

```
rc-update del NetworkManager
```

but my nameserver line is getting deleted. Based on other threads I've read, I also tried 

```

rm /etc/resolv.conf

touch /etc/resolv.conf

```

Just in case the file was a pre-existing symlink. No go there either. Any more ideas? I'm half-temped to just hack it and write a script that generates resolv.conf every time I log on   :Rolling Eyes: 

----------

## Underdone

Are you editing the resolv.conf file as root?

I also noticed something interesting in my resolv.conf file

```
# Generated by dhcpcd for interface ath0
```

If i'm understanding this correctly you shouldn't have to setup the file yourself if you're using dhcp

Also, did you update all of your config files?

----------

## jadfw007

Yup, I'm actually logged in as root as I'm doing all of this. You may be right about dhcp. I'm used to DNS discovery happening automatically, so I would've 

assumed that none of this would be necessary. Do you see anything in my /etc/conf.d/net or wireless files that might be overriding dhcp?

As for updating config files, which ones are you referring to? It wouldn't surprise me at all if I missed one or two.

----------

## jadfw007

I gave up trying to find an elegant solution.

Contents of /etc/init.d/resolv-conf-hack.sh:

```
chmod 644 /etc/resolv.conf

echo "nameserver 192.168.11.1" >/etc/resolv.conf
```

then...

```
chmod +x /etc/init.d/resolv-conf-hack.sh

rc-update add resolv-conf-hack.sh default
```

Now it works.

----------

## UberLord

 *baigsabeeh wrote:*   

> It has only one line.
> 
> ```
> domain home
> ```
> ...

 

dhcpcd (and baselayout for that matter) always put a header in that file to indicate what created it.

So I'm guessing that dhcpcd is not the issue here.

----------

## erik258

your dhcp server is misconfigured?  thats what it sounds like at least.

----------

## jadfw007

All other computers on my network are fine, as was the previous install on the machine I'm working on now. I haven't changed any settings on the wireless router. That doesn't mean it's not misconfigured, but it's been configured well enough for everything else so far.

----------

## erik258

 *Quote:*   

> That doesn't mean it's not misconfigured, but it's been configured well enough for everything else so far.

 

you are right about that, I just can't think of anything else.  If you didn't roll your own DHCP server, it's hard to blame that though.

----------

