title: How to check whether hostname is domain name in Go?
body: <p>How can I check whether <a href="https://golang.org/pkg/net/url/#URL.Hostname" rel="nofollow noreferrer">URL.Hostname</a> is a valid domain name? I am searching for the exact same behaviour as <a href="https://docs.microsoft.com/de-de/dotnet/api/system.uri.checkhostname" rel="nofollow noreferrer">URI.CheckHostName</a> in the .NET framework. </p>