Golang net.LookupNS() function example
package net
Golang net.LookupNS() function usage example
package main
import (
"fmt"
"net"
)
func main() {
nsRecord, err := net.LookupNS("socketloop.com")
if err != nil {
panic(err)
}
for i := 0; i < len(nsRecord); i++ {
fmt.Printf("Host : %s \n", nsRecord[i].Host)
}
}
Sample output :
Host : ns1.onlydomains.com.
Host : ns3.onlydomains.com.
Host : ns2.onlydomains.com.
References :
Advertisement
Something interesting
Tutorials
+5.4k Golang : Get S3 or CloudFront object or file information
+20.2k Golang : Determine if directory is empty with os.File.Readdir() function
+16.4k Golang : Test floating point numbers not-a-number and infinite example
+11k Golang : Create S3 bucket with official aws-sdk-go package
+12.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example
+17k Golang : XML to JSON example
+5.5k Golang : Display advertisement images or strings on random order
+13.5k Golang : Count number of runes in string
+21.3k Golang : Create and resolve(read) symbolic links
+6.9k Golang : Decode XML data from RSS feed
+17.9k Golang : Qt image viewer example