-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.10.3 darwin/amd64
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/qiufeng/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/qiufeng/go" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pr/1blgkr1j60bbscwnp21g4bqr0000gn/T/go-build995562236=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
package main
import (
"net"
"context"
"log"
)
func main() {
host:="*.qzone.qq.com"
log.Println(net.LookupHost(host))
r := net.Resolver{
PreferGo:true,
StrictErrors:true,
Dial: DNSDialer,
}
ctx := context.Background()
ipaddr, err := r.LookupHost(ctx, host)
if err != nil {
log.Println(err)
}
log.Println(ipaddr)
}
func DNSDialer(ctx context.Context, network, address string) (net.Conn, error) {
d := net.Dialer{}
return d.DialContext(ctx, "udp", "8.8.8.8:53")
}
What did you expect to see?
$ go run test2.go 2018/11/26 10:47:27 [180.163.21.59] 2018/11/26 10:47:27 [180.163.21.59]
What did you see instead?
$ go run test2.go 2018/11/26 10:47:27 [180.163.21.59] 2018/11/26 10:47:27 lookup *.qzone.qq.com: no such host 2018/11/26 10:47:27 []
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.