Validate input when add a server

This doesn't cover IPv6 addresses (which can take on various formats). Are we sure we want to validate the contents of the addresses and hostname? There are so many formats that these can take ... in addition we only partially validate them here.

The hostname/address must be a valid preexisting name/address. It's not like they're choosing one here. If they mistype an otherwise valid address, they still won't be able to connect. So I'm a bit suspicious of the validation here without a clear use case.