func IsValidDomain(host string) bool {
	host = strings.TrimSpace(host)
	if len(host) == 0 || len(host) > 255 {
		return false
	}
	if host[len(host)-1:] == "-" || host[:1] == "-" {
		return false
	}
	if host[len(host)-1:] == "_" || host[:1] == "_" {
		return false
	}
	if host[len(host)-1:] == "." || host[:1] == "." {
		return false
	}
	if strings.ContainsAny(host, "`~!@#$%^&*()+={}[]|\\\"';:><?/") {
		return false
	}
	return true
}
IsValidDomain validates if input string is a valid domain name.
package s3utils
import (
	"bytes"
	"encoding/hex"
	"errors"
	"net"
	"net/url"
	"regexp"
	"sort"
	"strings"
	"unicode/utf8"
)
var sentinelURL = url.URL{}