Documentation ¶
Overview ¶
Package dns standardizes checks for domain validity. All functions support punycode and unicode domains (IDN) by default.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasListedSuffix ¶
HasListedSuffix returns true if the domain has a TLD that appears on the public suffix list and false otherwise. Converts to ASCII to ensure suffix check succeeds but does no other normalization.
func IsListedSuffix ¶
IsListedSuffix returns true iff the argument `etld` is on the public suffix list, e.g., is a public or private effective top-level domain (eTLD).
func IsPossibleDomain ¶
IsPossibleDomain returns true if `domain` syntactically matches RFC 1035 and is or uses a known public or private TLD. Converts to ASCII to ensure suffix check succeeds but does no other normalization.
func IsRegisterableDomain ¶
IsRegisterableDomain returns true if `domain` syntactically matches RFC 1035 and uses a known public or private TLD but is not a TLD itself. This means the domain could be registered and used by a 3rd party, but the check does not resolve to see if it has been registered. Converts to ASCII to ensure suffix check succeeds but does no other normalization.
func Normalize ¶
Normalize is used to sanitize domain names so common inconsistencies do not occur. Domains flowing into the system from 3rd parties should always be normalized before storing and further processing. This function will: * trim trailing & leading whitespace * lowercase * convert to punycode An error is returned if the punycode conversion fails.
Types ¶
This section is empty.