...
Package dnsutil
Package dnsutil contains higher-level methods useful with the dns
package. While package dns implements the DNS protocols itself,
these functions are related but not directly required for protocol
processing. They are often useful in preparing input/output of the
functions in package dns.
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
func AddOrigin(s, origin string) string
AddDomain adds origin to s if s is not already a FQDN.
Note that the result may not be a FQDN. If origin does not end
with a ".", the result won't either.
This implements the zonefile convention (specified in RFC 1035,
Section "5.1. Format") that "@" represents the
apex (bare) domain. i.e. AddOrigin("@", "foo.com.") returns "foo.com.".
func TrimDomainName(s, origin string) string
TrimDomainName trims origin from s if s is a subdomain.
This function will never return "", but returns "@" instead (@ represents the apex (bare) domain).