Go program to find TXT records of a domain
This text record stores information about the SPF that can identify the authorized server to send email on behalf of your organization. The net.LookupTXT() function takes a domain name(facebook.com) as a string and returns a list of DNS TXT records as a slice of strings.
Example
package main
import (
"fmt"
"net"
)
func main() {
txtrecords, _ := net.LookupTXT("facebook.com")
for _, txt := range txtrecords {
fmt.Println(txt)
}
}
The single TXT record for gmail.com is shown below:
v=spf1 redirect=_spf.facebook.com
Most Helpful This Week
Use Field Tags in the Definition of Struct Type
Program in Go language to Find Largest Element of an Array
This sample program demonstrates how to decode a JSON string.
How to declare Interface Type in Go Programming Language
Web Application to Get Trending Hashtags Near a Location
Explain in Brief Golang error handling best practices