# Login and sudo password problems

## CrazyCasta

Sorry abt the nondescript title. The problem I'm having is that whenever the internet goes down (which is often, I'm trying to fix it) I can't log in because by system times out trying to resolve some host name. My question is, why is it trying to resolve some host name and what can I do to fix it (i.e. make it so that I can log in). The specific error message that it gives is "login timed out after 60 seconds". In the case of sudo, it still works without internet, it just takes a very very long time to ask for password, and then authenticate (I assume that it is once again trying to resolve something, timing out, and has a working fallback as opposed to the login problem). I'm not sure what file or files to check, so please let me know what you need.

----------

## ianw1974

It could well be your /etc/nsswitch.conf which should be checking files first than DNS settings.  There will be lines in there for:

```
passwd: files dns

group: files dns

shadow: files dns
```

I'm not on Gentoo right now to tell you exactly how mine is configured, but you basically want to have files before dns.

----------

## CrazyCasta

Ok, sounds good, but what hostname is it trying to resolve?

----------

## NeddySeagoon

CrazyCasta,

What does 

```
hostname -f
```

What do you have in /etc/hosts

The system is trying to resolve its own name

----------

