Golang Resolve Domain Name DNS Resolution

Golang Resolve Domain Name DNS Resolution

package main

import (
    "net"
    "log"
)

func main() {
    ret, err := net.LookupHost("www.baidu.com")
    if err != nil {
		log.Println(err.Error())
        return
    }

    for _, n := range ret {
        log.Println(n)
    }
}

Comments

Popular posts from this blog

Python Receiving and parse JSON Data via UDP protocol

ubus lua client method and event registration code demo/example