Skip to content

net: LookupHost shows different results between GODEBUG=netdns=cgo and go #22902

@ramspoluri

Description

@ramspoluri

What version of Go are you using (go version)?

go version go1.9.2 darwin/amd64

What did you do?

package main

import (
	"net"
	"fmt"
)

func main() {
	fmt.Println(net.LookupHost("10.256"))
	fmt.Println(net.LookupHost("10.256.1"))
	fmt.Println(net.LookupHost("10.10.256"))
	fmt.Println(net.LookupHost("10.10.256.1"))
	fmt.Println(net.LookupHost("10.10.10.256"))
}

What did you expect to see?

This program works fine on both Linux & Windows and does show below output, but not on Mac

[] lookup 10.256: no such host
[] lookup 10.256.1: no such host
[] lookup 10.10.256: no such host
[] lookup 10.10.256.1: no such host
[] lookup 10.10.10.256: no such host

What did you see instead?

[10.0.1.0] <nil>
[] lookup 10.256.1: no such host
[10.10.1.0] <nil>
[] lookup 10.10.256.1: no such host
[] lookup 10.10.10.256: no such host

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions