Skip to content

DNS lookup attempts for IP hostnames #488

@JustAnotherArchivist

Description

@JustAnotherArchivist

When fetching from an IP URL, wpull still performs a DNS lookup. This can be seen in the verbose log output (Lookup address):

$ wpull --debug --tries 1 http://127.0.0.1/
[...]
INFO Fetching ‘http://127.0.0.1/’.
DEBUG Client fetch request <Request(GET, http://127.0.0.1/, HTTP/1.1)>.
DEBUG Check out ('127.0.0.1', 80, False)
DEBUG Lookup address 127.0.0.1.
DEBUG Get item from source
DEBUG Resolved addresses: [_AddressInfo(ip_address='127.0.0.1', family=<AddressFamily.AF_INET: 2>, flow_info=None, scope_id=None)].
[...]

Notably, this appears to attempt an actual lookup over the network with dnspython. I only noticed this because I happened to be on a network where most traffic was being dropped (not refused or similar, just silently dropped, à la iptables DROP policy), including DNS. This caused wpull to hang on the DNS lookup until the timeout failed the retrieval.

wpull should obviously not be doing DNS lookups for IPs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions