1

Im trying to configure proftpd to depend on the host the user connected to, however the server has multiple domains per ip address.

In totalcommander I connect to "domain1.com" The server is configured for reverse dns "domain2.com"

and %V which is "server DNS NAME" in proftpd returns "domain2.com" (not the one the user connected to)

is it possible to detect what server the user CONNECTED to ?

n00b32
  • 199
  • 10

2 Answers2

3

No. FTP doesn't have the equivalent of HTTP's "host" header. If you want the same FTP server to respond differently when the user connects using different DNS domain names, you will need to assign each host name its own IP

Stephane
  • 6,432
  • 3
  • 26
  • 47
  • 1
    or force them to put username for example `test@test.com` . thank god i assumed it supports "host headers" before designing my database schema -.- – n00b32 Feb 06 '14 at 13:32
  • There are several ways to work around this, yes: you can use the "account" command, build the user name is ways that will make it unique globally (as you suggested) but it will not help with basic things like server banner or (more problematic) X509 certificate matching if you're using FTP(S). – Stephane Feb 06 '14 at 13:39
  • As of [RFC 7151](https://tools.ietf.org/html/rfc7151), there is now a `HOST` FTP command for supporting proper name-based FTP virtual hosts, akin to HTTP 1.1's `Host` header. – Castaglia Feb 28 '16 at 01:23
  • @Castaglia Do you know how common it is for clients to support RFC 7151? – jonelf Apr 25 '18 at 16:12
  • @jonelf Unfortunately I do not know how widespread client support for RFC 7151 is. – Castaglia Apr 27 '18 at 03:01
1

As far as I know, there is no Host header in FTP. Microsoft IIS however supports virtual hosts by username ("ftp.domain.tld|username" or "ftp.domain.tld\username").