diff options
Diffstat (limited to 'src/pkg/net/lookup.go')
-rw-r--r-- | src/pkg/net/lookup.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pkg/net/lookup.go b/src/pkg/net/lookup.go index 7b2185ed4..eeb22a8ae 100644 --- a/src/pkg/net/lookup.go +++ b/src/pkg/net/lookup.go @@ -36,3 +36,15 @@ func LookupPort(network, service string) (port int, err os.Error) { } return } + +// LookupCNAME returns the canonical DNS host for the given name. +// Callers that do not care about the canonical name can call +// LookupHost or LookupIP directly; both take care of resolving +// the canonical name as part of the lookup. +func LookupCNAME(name string) (cname string, err os.Error) { + cname, err, ok := cgoLookupCNAME(name) + if !ok { + cname, err = goLookupCNAME(name) + } + return +} |