WinSCP should trim whitespace on hostnames. I spent a good hour troubleshooting my DNS when I got the error. I finally realized that WinSCP couldn't resolve the domain because there was a trailing blank space after the hostname left over from cutting/pasting it into WinSCP.
Maybe it's user error (hah!) but WinSCP should handle it gracefully.