Skip to content

Conversation

@gitsrc
Copy link
Contributor

@gitsrc gitsrc commented Mar 11, 2025

This PR refactors the hostname handling logic to skip DNSLink lookups for IP addresses.

The hasDNSLinkRecord function now explicitly checks if the provided hostname is an IP address. If it is an IP address, the function immediately returns false, skipping the DNSLink lookup.

This change avoids unnecessary DNS queries when the hostname is an IP address. This improves efficiency and reduces potential delays, especially in local development environments where DNS lookups for IPs are not needed and can sometimes cause issues.

Closes #879

@gitsrc gitsrc requested review from a team and lidel as code owners March 11, 2025 11:58
@gitsrc gitsrc changed the title Refactor(hostname): Skip DNSLink lookup for local IP addresses to avo… Refactor(hostname): Skip DNSLink for local IP addresses to avoid DNS queries Mar 11, 2025
@gammazero gammazero self-assigned this Mar 11, 2025
@gammazero
Copy link
Contributor

Turns out that we need to igore app IP addresses, not just localhost.

@gammazero gammazero merged commit cf6b088 into ipfs:main Mar 12, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow responses to requests on 127.0.0.1 when DNSLink enabled

2 participants