Views:

Error 530 Valid Hostname is expected using FTP to IIS7+

Issue

When connecting to IIS7 using FTP you get the following error.

530 Valid Hostname is expected

Reason

When you set up name-based FTP services IIS7 wants the sitename defined with the username so that IIS7 can associate the username with the site they wish to log in to.

Solution A

If you want more than one FTP site on your VPS you will need to :

Configure all FTP clients such that :
Host: Mysite.com
User: Mysite.com|Username

Note the "|" that seperates the Sitename and the Username.

Solution B

If you only have one FTP site remove the "Host Name" defined in the "Bindings" property of the FTP site.

Additional notes for later versions of IIS

for later versions like IIS10, there are some additional points to consider:

If you’re setting up IIS10 for multiple sites, you might encounter the same “530 Valid hostname is expected” error. The solution remains the same: you need to configure all FTP clients such that the Host is Mysite.com and the User is Mysite.com|Username, where | separates the Site name and the Username.

If you’re developing software that connects to the FTP site and the "host|username" syntax doesn’t work, one solution suggested on MSDN is to run FTP on the ‘default website’ in IIS.

Another workaround for IIS-specific username syntax is to use a backslash character instead of the pipe (vertical line) character. So the syntax would look like ftp.contoso.com\username or ftp.fabrikam.com\username.

If you’re using IIS FTP Server, make sure the user has the required permissions. You can check this by right-clicking the folder and going to Properties. In the Security tab, ensure the user has the necessary permissions.

Get in touch

For any additional help, give us a call on 0800 477 333 (8AM to 10PM, 7 days a week).