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 Comb Sort
How to create an empty Slice in Golang?
How append a slice to an existing slice in Golang?
Find out how many logical processors used by current process
GO language program with example of Sort Functions for integer, strings and float64 data type
Go program to find CNAME record of a domain
Nested Struct Type
Golang program for implementation of Linear Search
GO Program to Generate Fibonacci Sequence Up to a Certain Number
GO Program to Generate Multiplication Table