lighttpd forum lighty > Bind to localhost fails

Posted by Lea Wiemann (Guest)
on 07.04.2008 06:40
Hi!

I'm using the following lines in my configuration file:

## bind to localhost only (default: all interfaces)
server.bind                = "localhost"

If I start lighttpd, I get the following message:

# lighttpd -f /etc/lighttpd/lighttpd.conf
2008-04-07 02:38:41: (network.c.201) getaddrinfo failed:  Name or 
service not known ' localhost '

It works fine if I uncomment the server.bind line, though lighttpd will 
obviously bind to all interfaces.

I'm using the 1.4.19-1 Debian package.

Any hints appreciated!

Best wishes,

    Lea
Posted by Olaf van der Spek
on 07.04.2008 09:05
Lea Wiemann wrote:
> Any hints appreciated!

Does ping localhost work?
What if you use 127.0.0.1 or ::1?
Posted by Waldi (Guest)
on 20.05.2008 01:48
same here
same package version
libc6                         2.7-10

> What if you use 127.0.0.1 or ::1?
it has to be a hostname

my DNS works great; localhost is in the /etc/hosts file - perhaps an 
error with getaddrinfo?
Posted by Olaf van der Spek
on 20.05.2008 15:41
Waldi wrote:
> same here
> same package version
> libc6                         2.7-10
> 
>> What if you use 127.0.0.1 or ::1?
> it has to be a hostname

Says who? Why?
Posted by Guest (Guest)
on 03.07.2008 05:10
I have this issue too.

I have this in my hosts file:

127.0.0.1 foobar localhost

If I swap them around I still get the same issue.

If I use 127.0.0.1 instead, I get this error:

2008-07-03 12:59:04: (network.c.201) getaddrinfo failed:  Address family 
for hostname not supported ' 127.0.0.1 '

Ping localhost works fine:

# ping localhost
PING foobar (127.0.0.1) 56(84) bytes of data.
64 bytes from foobar (127.0.0.1): icmp_seq=1 ttl=64 time=0.037 ms
64 bytes from foobar (127.0.0.1): icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from foobar (127.0.0.1): icmp_seq=3 ttl=64 time=0.025 ms

# ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.027 ms