Skip to content

Domain names should be resolved on the remote host if --dns is specified #965

Open

Description

@fandreuz

I noticed that domain names passed as CLI arguments to sshuttle are resolved locally via socket.getaddrinfo. In some cases the name is only resolvable by the remote host (e.g. private VPCs), which I think is the use case for --dns. In such a situation, the script fails with Unable to resolve address ...

I propose to allow resolving the names on the remote machines if --dns appears in the command; either always, or only if the name cannot be resolved, if backward compatibility is a concern in this case.

Related to #844

Activity

  1. germaniuss commented on Nov 8, 2024

    @germaniuss

    +1 to this issue. I have a company VPN configured on my work laptop, so to work from home I usually route everything through the laptop with the --dns option. It is however not ideal to route connections that are not company specific through the VPN so it would be useful to specify something like
    sshuttle --dns -r <user>@<remote> -x <remote> my.company.url

  2. Sakoes commented on Jun 18, 2025

    @Sakoes

    Would also help for accessing services that only resolve to ip's when on a remote host. Would be a great feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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