Skip to main content

Access GitHub, Docker Hub & LLM APIs from IPv6-only VPS

VirtualLabs and some IPv6-only VPS instances can't directly reach services that are still IPv4-only, such as GitHub, Docker Hub, and OpenAI. This tutorial provides practical solutions so you can still git clone, git push, docker pull, docker login, and call LLM APIs from a VPS that only has an IPv6 address.

The Problem

git clone https://github.com/user/repo.git
docker pull nginx:latest
curl https://api.openai.com/v1/chat/completions

You might get errors like:

fatal: unable to access 'https://github.com/...': Could not resolve host: github.com
Error response from daemon: ... dial tcp: lookup registry-1.docker.io: no such host
curl: (6) Could not resolve host: api.openai.com

This happens because GitHub, Docker Hub, OpenAI, and many developer services still don't support direct IPv6 connections (as of June 2026).


Solution 1: GitHub via IPv6 Proxy

Route traffic to GitHub through an IPv6 proxy — a server that accepts IPv6 and forwards to GitHub over IPv4. Add mappings to /etc/hosts.

Choose a Proxy

Best for VPS on TransIP / SandboxVPS.

/etc/hosts
2a01:7c8:7c8::1337 github.com
2a01:7c8:7c8::1337 api.github.com
2a01:7c8:7c8::1337 codeload.github.com
2a01:7c8:7c8::1337 objects.githubusercontent.com
2a01:7c8:7c8::1337 raw.githubusercontent.com

Apply

sudo nano /etc/hosts
# Paste entries at the end → CTRL+X → Y → Enter
curl -I https://github.com 2>&1 | head -5
git clone https://github.com/Adekabang/docs-8labs.git
note
  • SSH: Proxy only works for HTTPS. Use HTTPS remotes or set up an SSH proxy jump for [email protected].
  • Rate limiting: Public proxies hit rate limits faster — use a PAT for authenticated requests.

Solution 2: Docker Hub via IPv6 Endpoint

Docker Hub provides a dedicated IPv6 beta endpoint: registry.ipv6.docker.com.

Login & Pull

docker login registry.ipv6.docker.com

# Official images (use "library/" prefix)
docker pull registry.ipv6.docker.com/library/ubuntu:latest
docker pull registry.ipv6.docker.com/library/nginx:latest

# User images
docker pull registry.ipv6.docker.com/storjlabs/watchtower:latest

Dockerfile

Dockerfile
FROM registry.ipv6.docker.com/library/node:20-alpine
WORKDIR /app
COPY . .
RUN npm install
CMD ["node", "index.js"]

Mirror (optional)

Set up a daemon mirror to avoid prefixing every pull:

/etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.ipv6.docker.com"]
}
sudo systemctl restart docker

Now docker pull nginx:latest works without any prefix.


Solution 3: NAT64 + DNS64

A universal solution — DNS64 automatically translates IPv4 addresses to IPv6, letting your VPS reach the entire IPv4 internet.

Google DNS64

nameserver 2001:4860:4860::6464
nameserver 2001:4860:4860::64
sudo nano /etc/resolv.conf
# Replace nameserver entries with lines above
warning

NAT64 only works for outbound connections. You cannot expose services to the IPv4 internet this way.


Solution 4: LLM APIs — Native IPv6, OpenRouter Gateway & NAT64

Most LLM API providers support IPv6 natively (via Cloudflare or their own infrastructure). The major exception is OpenAI (api.openai.com), which has no AAAA record and cannot be reached directly from an IPv6-only VPS.

IPv6 Support per Provider (June 2026)

ProviderEndpointIPv6ViaWorkaround
OpenAIapi.openai.com❌ NoOpenRouter proxy or NAT64
Anthropicapi.anthropic.com✅ YesNativeNone needed
Google Geminigenerativelanguage.googleapis.com✅ YesNativeNone needed
OpenRouteropenrouter.ai✅ YesCloudflareNone needed
Groqapi.groq.com✅ YesCloudflareNone needed
DeepSeekapi.deepseek.com✅ YesCloudFrontNone needed
Mistralapi.mistral.ai✅ YesNativeNone needed
Perplexityapi.perplexity.ai✅ YesCloudflareNone needed
Together AIapi.together.xyz✅ YesCloudflareNone needed
Fireworksapi.fireworks.ai✅ YesCloudflareNone needed

Option A: OpenRouter as Gateway (Simplest for OpenAI)

OpenRouter has native IPv6 and proxies all models — including every OpenAI model. No NAT64 or proxy needed.

# Replace api.openai.com with openrouter.ai
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer *** \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Hello from IPv6-only VPS"}]
}'
# Python example using openai package — point to OpenRouter
from openai import OpenAI

client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="sk-or-***",
)
response = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

OpenRouter model list shows all available models with their id prefix (openai/, anthropic/, google/, etc.).

tip

OpenRouter also supports Anthropic, Google, Meta, DeepSeek, and 200+ models — all from a single IPv6 endpoint. Great as a single gateway from IPv6-only infrastructure.

Option B: NAT64 + DNS64 (Universal)

If you need direct access to OpenAI's API (e.g., for Assistants API, fine-tuning endpoints, or compliance), use NAT64. Configure DNS64 as shown in Solution 3, then:

# Now works — DNS64 translates api.openai.com to IPv6
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer *** \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello"}]
}'

Option C: Call IPv6-Native Providers Directly

For providers that already have IPv6, just use their native endpoints — no workaround needed:

# Anthropic — works directly
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: sk-ant-*** \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello"}]
}'

# Groq — works directly
curl https://api.groq.com/openai/v1/chat/completions \
-H "Authorization: Bearer *** \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.3-70b-versatile",
"messages": [{"role": "user", "content": "Hello"}]
}'

Verification

# GitHub
curl -I https://github.com 2>&1 | head -3
git ls-remote https://github.com/Adekabang/docs-8labs.git

# Docker Hub
docker pull registry.ipv6.docker.com/library/hello-world:latest
docker run --rm hello-world

# LLM APIs
curl -s https://openrouter.ai/api/v1/models | head -c 200
curl -s https://api.anthropic.com/ 2>&1 | grep -o "Anthropic"
curl -6 -s -o /dev/null -w "%{http_code}" https://generativelanguage.googleapis.com/

Troubleshooting

IssueSolution
git push fails via HTTPSUse a Personal Access Token (PAT), not password
SSH [email protected] still failsSwitch remote to HTTPS: git remote set-url origin https://github.com/user/repo.git
Docker pull keeps timing outPull directly: docker pull registry.ipv6.docker.com/library/<image>
curl succeeds but git failsCheck .gitconfig for conflicting proxy settings
Proxy slow / times outTry an alternate proxy or NAT64
curl: (6) Could not resolve host: api.openai.comUse OpenRouter gateway or enable NAT64/DNS64 (Solution 3)
OpenRouter returns 401 UnauthorizedVerify API key — OpenRouter uses sk-or- prefix, not OpenAI keys
Python openai package fails on IPv6-onlySet base_url="https://openrouter.ai/api/v1" or configure DNS64
openai Assistants API / fine-tuning not on OpenRouterUse NAT64/DNS64 for direct api.openai.com access

References

Community Resources