Go program to find CNAME record of a domain

This is the abbreviation for canonical name. CNAMEs are essentially domain and subdomain text aliases to bind traffic. The net.LookupCNAME() function accepts a host-name(m.facebook.com) as a string and returns a single canonical domain name for the given host.


package main
import (
func main() {
	cname, _ := net.LookupCNAME("m.facebook.com")

The CNAME record that was returned for the m.facebook.com domain is shown below:

Most Helpful This Week