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
+9.7k Golang : List available AWS regions
+4.9k Javascript : How to get width and height of a div?
+4.7k Adding Skype actions such as call and chat into web page examples
+15.4k Golang : invalid character ',' looking for beginning of value
+5k Linux : How to set root password in Linux Mint
+10.5k Generate Random number with math/rand in Go
+10.2k Golang : Random Rune generator
+5.3k PHP : Hide PHP version information from curl
+11.7k How to tell if a binary(executable) file or web application is built with Golang?
+7.1k Golang : Validate credit card example
+6.5k PHP : Shuffle to display different content or advertisement