Skip to content

Error DNS in Linux #9517

Description

@Swampertian

Describe the bug

Apollo Router fails to resolve host machine subgraphs when running inside Docker on native Linux.

In a hybrid local development setup (Apollo Router in Docker, subgraphs running directly on the Linux host), using host.docker.internal in subgraph routing URLs causes Apollo Router to fail with a DNS resolution error.

To Reproduce

  1. Run Apollo Router inside Docker.
  2. Run GraphQL subgraphs directly on the Linux host.
  3. Configure the supergraph:
subgraphs:
  example:
    routing_url: http://host.docker.internal:5100/example
    schema:
      subgraph_url: http://host.docker.internal:5100/example
  1. Start Apollo Router.
  2. Execute a query that routes to the subgraph.

Expected behavior

Apollo Router should either:

  • support resolving host machine services in Linux development environments, or
  • clearly document the expected Linux networking setup for this scenario.

Actual behavior

Apollo Router fails with:

Upstream service error: Unexpected(reqwest::Error {
  kind: Request,
  url: "http://host.docker.internal:5100/beach",
  source: hyper_util::client::legacy::Error(
    Connect,
    ConnectError(
      "dns error",
      Custom {
        kind: Uncategorized,
        error: "failed to lookup address information: Name or service not known"
      }
    )
  )
})

Testing with the Docker bridge IP instead:

http://172.17.0.1:5100/beach

changes the failure to:

Connection refused

which suggests Apollo Router can reach the host network path, but host.docker.internal resolution is the blocking issue.

Environment

  • OS: Arch Linux
  • Docker Engine (native Linux)
  • Apollo Router (Docker image)
  • .NET Aspire local orchestration
  • Subgraphs running directly on host machine

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions