# What is my IPv6 address? Test if IPv6 works | host.sh

> See your IPv6 and IPv4 addresses and whether IPv6 works on this connection: a free IPv6 test in the browser, plus the curl commands to check it.

## How the test works

Your browser asks the host.sh API for your address over `api.host.sh`, which has both an IPv6 and an IPv4 address (a dual-stack host). The address the API sees tells which one your browser used for this request. A second request goes to `ipv4.host.sh`, which has an IPv4 address only, to show your IPv4 address too.

- **IPv6 address shown, IPv4 too**: your connection is dual-stack, and IPv6 works.
- **IPv6 not detected**: your browser reached a dual-stack host over IPv4. Browsers usually prefer IPv6 when it works, so your network probably has no IPv6, or it is turned off on this device. This test can't be sure: a browser can fall back to IPv4 when IPv6 is slow.
- **IPv4 not detected** next to an IPv6 address: your network may be IPv6-only with no IPv4 path to `ipv4.host.sh`, or the request was blocked.

The test makes one or two tokenless lookups of your own address and nothing else. It needs no sign-up.

## IPv6 and IPv4 addresses

An IPv4 address is four numbers from 0 to 255, like `203.0.113.7`. An IPv6 address is eight groups of four hexadecimal digits, written short by dropping leading zeros and replacing one run of zero groups with `::`, like `2001:db8::1`. Many devices use a temporary IPv6 address for outgoing connections and change it now and then, so the address you see here can differ from the one in your network settings.

## From the command line

```sh
curl -6 https://host.sh/ip    # your IPv6 address, fails without IPv6
curl -4 https://host.sh/ip    # your IPv4 address
```

Without `-4` or `-6`, curl picks one the same way a browser does. More commands are on the [curl page](https://www.host.sh/curl/index.md).

## FAQ

### Why do I have two IP addresses?

A dual-stack connection has an IPv4 and an IPv6 address at the same time. Sites that support IPv6 see the IPv6 one, older sites see the IPv4 one, so both are yours.

### Why does the test say IPv6 is not detected?

Your browser reached host.sh over IPv4 although host.sh has IPv6. That usually means your provider, router or device doesn't offer IPv6, or IPv6 is switched off on this device. Now and then a browser falls back to IPv4 while IPv6 works but is slow; `curl -6 https://host.sh/ip` tells the two apart.

### Does host.sh look up IPv6 addresses?

Yes. The [lookup](https://www.host.sh/lookup/index.md) and the [API](https://www.host.sh/docs/lookup/index.md) take IPv4 and IPv6 addresses alike, and `connection.version` in the answer says which one it is.

### How do I check IPv6 from a terminal?

Run `curl -6 https://host.sh/ip`. It prints your IPv6 address when IPv6 works and fails with a connection error when it doesn't.
