Golang net.LookupCNAME() function example

package net

Golang net.LookupCNAME() function usage example

For example, in socketloop.com's domain configuration, a CNAME was configure for receiving email

host : zb14031726

type : CNAME

content : zmverify.zoho.com.

and

 package main

 import (
 "fmt"
 "net"
 )

 func main() {
 DOMAINcname, err := net.LookupCNAME("zb14031726.socketloop.com")
 fmt.Println(DOMAINcname, err)

 }

will translate the CNAME to equivalent hostname

business.zoho.com.

Reference :

http://golang.org/pkg/net/#LookupCNAME

Advertisement