Skip to content

DNS lookup for localhost fails on Linux #63

Open
@da-terry

Description

@da-terry

When using "localhost" (after removing the proxy restriction), Lookup tries to do a DNS A lookup using the search domain from resolv.conf, which will fail in most cases for obvious reasons. It seems to ignore /etc/hosts as a first lookup step.

Trying to use 127.0.0.1 instead fails as well, since HTTPClient does a reverse lookup and sends "localhost" again to BrowserMobHostNameResolver.

The only workaround I've found is to use a remap rule, like so:

proxy.start()
proxy.remapHost("localhost", "127.0.0.1")

This bypasses the broken DNS lookup.

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