Go program to find PTR pointer record of a domain
These records provide the reverse binding from addresses to names. PTR records should exactly match the forward maps. The net.LookupAddr() function performs a reverse finding for the address and returns a list of names that map to the given address.
Example
package main
import (
"fmt"
"net"
)
func main() {
ptr, _ := net.LookupAddr("6.8.8.8")
for _, ptrvalue := range ptr {
fmt.Println(ptrvalue)
}
}
For the given address the above program returns a single reverse record as shown below:
tms_server.yuma.army.mil
Most Helpful This Week
How to print string with double quote in Go?
How do you set headers in an HTTP response in Go?
Cannot call non-function <variable> error in Golang
How to add items to Slice using append function in Golang?
Make Your Retirement Luxurious with These 5 Game-Changing Altcoins
Golang program for implementation of Knuth–Morris–Pratt (KMP) Algorithm