Skip to content

std::net::lookup_host repeats output #24250

Closed
@nieksand

Description

@nieksand

Using std::net::lookup_host seems to duplicate each IP in the result set.

prompt> ./main rust-lang.org
V4(72.8.141.90:0)
V4(72.8.141.90:0)

prompt> ./main google.com | sort
V4(74.125.28.100:0)
V4(74.125.28.100:0)
V4(74.125.28.101:0)
V4(74.125.28.101:0)
V4(74.125.28.102:0)
V4(74.125.28.102:0)
V4(74.125.28.113:0)
V4(74.125.28.113:0)
V4(74.125.28.138:0)
V4(74.125.28.138:0)
V4(74.125.28.139:0)
V4(74.125.28.139:0)
V6([2607:f8b0:400e:c04::66]:0)
V6([2607:f8b0:400e:c04::66]:0)

The documentation snippet (https://doc.rust-lang.org/std/net/fn.lookup_host.html) is enough to reproduce.

I also have a simple gist here: https://gist.github.com/nieksand/9c42100be6dc52df3305

I'm using the latest Rust from master branch on MacOS X 10.9.5. I have not checked on other platforms. I see this for any hostname that I try, so I don't think it's a problem on the nameserver side.

Expected behavior is seeing each IP address listed only once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions