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
Golang program for implementation of Median of Medians
Write string slice line by line to a text file
GO language program with example of Array Reverse Sort Functions for integer and strings
How to check if an item exists in Slice in Golang?
How do you handle HTTP client server security in Go?
How do you create an HTTP server in Go?
How to write backslash in Golang string?
Golang program for implementation of Linked List
Golang program for implementation of Bubble Sort
GO Program to Check Armstrong Number