# Authentication stack without internet connection



## sk8harddiefast (Jul 10, 2010)

I have this strange problem.
My internet connection some times breaks and fore some seconds / minutes i have no internet.
The problem is that then, my system has strange behaviour.
Sudo is not working. I am waiting ~ 30 seconds to do something.
Any ideas?


----------



## SirDice (Jul 10, 2010)

Sounds like your system is unable to resolve localhost and/or it's own hostname. Make sure you've set both in /etc/hosts correctly (both can point to 127.0.0.1).


----------



## sk8harddiefast (Jul 10, 2010)

This is my /etc/hosts

```
# $FreeBSD: src/etc/hosts,v 1.16.34.1.2.1 2009/10/25 01:10:29 kensmith Exp $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1			localhost localhost.my.domain
127.0.0.1		localhost localhost.my.domain
#
# Imaginary network.
#10.0.0.2		myname.my.domain myname
#10.0.0.3		myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#	10.0.0.0	-   10.255.255.255
#	172.16.0.0	-   172.31.255.255
#	192.168.0.0	-   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
```

What i must add?


----------



## SirDice (Jul 10, 2010)

Change the "localhost.my.domain" in the hosts file to the hostname you've set in rc.conf.


----------



## sk8harddiefast (Jul 10, 2010)

My hostname is bsdserver.bsd
So i should write

```
::1			localhost localhost.my.domain
127.0.0.1		localhost bsdserver.bsd
```
?


----------



## SirDice (Jul 10, 2010)

Yes, for good measure add the short name (bsdserver) to that line too.

Do the same for ::1 (IPv6 localhost).


----------



## sk8harddiefast (Jul 10, 2010)

like this:

```
::1			bsdserver localhost.my.domain
127.0.0.1		localhost bsdserver.bsd
```
? Done


----------

