You are not logged in.

#1 2009-11-20 09:51:24

Malo
Member
Registered: 2006-12-02
Posts: 43

Unresolvable local dns in hosts.allow

Hi.. i've just setup a local server that i use (with my office mates) for developing webapps..
I used firestarter as firewall and all the rules are right setted.

This is my /etc/hosts

# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1               archBox.localdomain     archBox
127.0.0.1               localhost.localdomain   localhost
100.41.27.5             archbox.localdomain     archbox
100.41.27.2             eeeBox.localdomain      eeeBox
100.41.27.1             simone.localdomain      simone
100.41.27.3             daniele.localdomain     daniele
# End of file

I've mapped my localhost with 2 domain name.. i know that it's not so common, but i think that's nothing wrong with that. However, this is not the question.

I need to ssh to my server, so i've added this line to /etc/hosts.allow

sshd: eeeBox, daniele, simone, elio

and added in firestarter the rules for allowing eeeBox, daniele, simone, elio to access the sshd service (NOTE: I've used the hostname defined in /etc/host)

If i try to connect to ssh, the connection fail. But if i modify hosts.allow wiith this line

sshd: eeeBox, daniele, simone, elio, 100.41.27.3, 100.41.27.1

now daniele, simone successufully connect to sshd service!

It looks like the system couldn't resolve the hostname that i've put inside hosts.allow.


Why i can't use the hostname declared in /etc/hosts for hosts.allow?

On the server i've installed dnsmasq also..

I'hope you understand me wink

Offline

#2 2009-11-20 10:06:46

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: Unresolvable local dns in hosts.allow

shouldn't you be using another column in /etc/hosts like this?

#<ip-address>   <hostname.domain.org>   <hostname>       (i guess from now on are just aliases which you may want)
127.0.0.1      archlinux.domain.org   localhost.localdomain      localhost    archlinux

http://wiki.archlinux.org/index.php/HOS … e_hostname

Last edited by quarkup (2009-11-20 10:35:36)


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#3 2009-11-20 12:44:06

Malo
Member
Registered: 2006-12-02
Posts: 43

Re: Unresolvable local dns in hosts.allow

Ok, now /etc/host it's in the right way..

But, again, i want to know why i can't use domain name (defined in /etc/hosts) instead of IP in /etc/hosts.allow..

Offline

#4 2009-11-20 16:01:32

Malo
Member
Registered: 2006-12-02
Posts: 43

Re: Unresolvable local dns in hosts.allow

Ok, i've got it!

the correct /etc/hosts

#<ip-address>   <hostname.domain.org>     <hostname>
127.0.0.1           archBox.domain.org           localhost.localdomain      localhost    archBox
100.41.27.2        eeeBox.localdomain           eeeBox
100.41.27.1        simone.localdomain           simone
100.41.27.3        daniele.localdomain           daniele
# End of file

and the correct /etc/host.allow (i need to specify the domain)

#
# /etc/hosts.allow
#

sshd: .localdomain :ALLOW
cvs: .localdomain : ALLOW
swat: .localdomain : ALLOW
mysqld: .localdomain : ALLOW
mysqld-max: .localdomain : ALLOW

# End of file

Offline

Board footer

Powered by FluxBB