Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in dns.lookup for ipv6 hostnames #16214

Open
bondehagen opened this issue Jan 7, 2025 · 0 comments
Open

Error in dns.lookup for ipv6 hostnames #16214

bondehagen opened this issue Jan 7, 2025 · 0 comments
Labels

Comments

@bondehagen
Copy link

bondehagen commented Jan 7, 2025

What version of Bun is running?

1.1.38

What platform is your computer?

x64

What steps can reproduce the bug?

import { dns } from "bun"

const hostname = "2001:db8:0:0:1:0:0:2";
const address = await dns.lookup(hostname, {
	family: 6
})
console.log("lookup", address);

What is the expected behavior?

lookup [
  {
    address: "2001:db8::1:0:0:2",
    family: 6,
    ttl: 0,
  }
]

What do you see instead?

lookup [
  {
    address: "2001:db8::1:2",
    family: 6,
    ttl: 0,
  }
]

Additional information

This happens with hostnames that resolves to ipv6 addresses that get compressed wrong when you have multiple zero runs. I tracked it down to the standard lib in Zig and made a pull request there ziglang/zig#22440

This leads to errors for other api's as well that depend on ipv6 from zig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants