Welcome to the Linux Foundation Forum!

hosts.allow question


hi there,

i have a basic question about general use of /etc/hosts.allow

is it possible to have multiple lines for the same protocol ?

right now i have 1 line for vsftpd like:

vsftpd: xxx1 , xxx2, xxx3 : allow

(where xxx1,2 and 3 are IP i want to allow)

it works but its easy to forget which ip belong to who ..

i'd like to do like this if its possible:

# john doe

vsftpd: xxxx1 : allow

# smith

vsftpd: xxxx2 : allow

# michael

vsftpd: xxxx3 : allow

is it possible ?


  • Rovanion
    I do personally have no clue but you can always read the manual for hosts.allow either by typing
    man hosts.allow
    or visiting this site: http://linux.die.net/man/5/hosts.allow
  • Wicked
    I'm going to take a stab in the dark here, please correct me if im wrong. I want to test my knowledge, without doing any research . You would like to solve the following issue : forgetting which IP belongs to specific Nodes..

    Would the following syntax work? Doesn't the semicolon break the line then allow you to write notes behind it?
    #                  IP Addresses         Names
    vsftpd:           ; John
                           ; Roger

    Or maybe something like that to If the above doesn't work. and if you had mulitple lines you would start a second line of names.
    #           John               Roger
    #   Chris         Same

    Technically you could have multiple lines because say you have 20 IP's that you need to allow. They all wouldn't fit on one line. So it would end up looking like this.

    vsftpd:,,,,,,,,,,,,, : allow

    But that's just taking a stab in the dark... I would say, make a back up of the file and play around with it. If you get a syntax error then you know you can't do it.


Upcoming Training