---
title: Testing domains using command line utilities
summary: null
url: >-
  https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/testing-domains-using-command-line-utilities
---

After you [create a domain](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-domains) and activate your service configuration, we recommend testing that domain with either the [Fastly control panel](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-domains#testing-a-domain) or command line utilities we provide to help you identify DNS issues or problems with your Fastly configuration. This guide focuses on using the command line utilities for that testing and covers how to:

1. [find the IP address of a Fastly POP](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/testing-domains-using-command-line-utilities#determining-the-ip-address-of-a-fastly-pop)
2. [add a domain Host entry to your hosts file](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/testing-domains-using-command-line-utilities#modifying-your-hosts-file)
3. [test the domain in a web browser](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/testing-domains-using-command-line-utilities#testing-your-domain)

> **HINT:** If you don't want to use the command line utilities to test your domain, you can [use the Fastly control panel](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-domains#testing-a-domain) to point to Fastly and test whether or not your configuration is working.

## Before you begin

This guide assumes you've [created a domain](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-domains).

## Determining the IP address of a Fastly POP

Use the `host`, `nslookup`, or `dig` command to determine the IP address of a Fastly POP. You'll use this information to temporarily [modify your hosts](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/testing-domains-using-command-line-utilities#modifying-your-hosts-file) file in order to test things properly. We return different IP addresses depending on the location and state of the network making the request. As a result, the IP address you receive for any specific query may differ from the below examples but should result in the best performance for you.

> **IMPORTANT:** For non-TLS requests, use `dualstack.nonssl.global.fastly.net` for connection over [IPv6](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/enabling-dualstack-connections). For TLS requests, use the [custom TLS CNAME record](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-cname-records-and-your-dns-provider#tls-enabled-hostnames) provided in the Fastly control panel or by Fastly support. For more information about the Fastly TLS service, see our guide on [TLS service options](https://docs.fastly.com/products/tls-service-options).

Running `host` for your domain returns both IPv4 addresses and IPv6 addresses:

```term nolinenums
$ host www.example.com.
www.example.com.is an alias for dualstack.nonssl.global.fastly.net.
dualstack.nonssl.global.fastly.net has address 199.232.144.204
dualstack.nonssl.global.fastly.net has IPv6 address 2a04:4e42:64::204
```

In this example, the IPv4 address is `199.232.144.204` and the IPv6 address is `2a04:4e42:64::204`.

Running `nslookup` for `dualstack.nonssl.global.fastly.net` also returns both IPv4 addresses and IPv6 addresses:

```term nolinenums
$ nslookup  dualstack.nonssl.global.fastly.net.
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   dualstack.nonssl.global.fastly.net
Address: 199.232.144.204
Name:   dualstack.nonssl.global.fastly.net
Address: 2a04:4e42:64::204
```

In this example, the IPv4 address is `199.232.144.204` and the IPv6 address is `2a04:4e42:64::204`.

Alternatively, you can run `dig` to determine the IP address, but you must specify an A query for IPv4 addresses or a AAAA query for IPv6 addresses.

Running `dig` for your domain with an A query returns:

```term nolinenums
$ dig +noall +answer -t A www.example.com.
www.example.com.        3600    IN      CNAME   dualstack.nonssl.global.fastly.net.
dualstack.nonssl.global.fastly.net. 30 IN A     199.232.144.204
```

The IPv4 address is `199.232.144.204`

Running `dig` for your domain with an AAAA query returns:

```term nolinenums
$ dig +noall +answer -t AAAA www.example.com.
www.example.com.        3600    IN      CNAME   dualstack.nonssl.global.fastly.net.
dualstack.nonssl.global.fastly.net. 30 IN AAAA  2a04:4e42:64::204
```

The IPv6 address is `2a04:4e42:64::204`.

## Modifying your hosts file

Using the IP address determined above, temporarily add a static IP address and domain Host entry to the hosts file on your computer. Once you make this temporary change [test your domain](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/testing-domains-using-command-line-utilities#testing-your-domain) to prove that traffic is flowing the right way.

Use the following anycast IPs for testing your sites served over `dualstack.nonssl.global.fastly.net`.

| IPv4            | IPv6               |
| --------------- | ------------------ |
| 151.101.0.204   | 2a04:4e42::204     |
| 151.101.64.204  | 2a04:4e42:200::204 |
| 151.101.128.204 | 2a04:4e42:400::204 |
| 151.101.192.204 | 2a04:4e42:600::204 |

For example, if the domain you are testing is `www.example.com` and you are using the anycast IPv4 example `151.101.0.204`, you would add this entry to the file and save the changes:

```plain
151.101.0.204 www.example.com
```

> **HINT:** On machines running macOS or Linux, your hosts file is `/etc/hosts`. On Windows-based machines, it's `C:\Windows\System32\Drivers\etc\hosts`.

## Testing your domain

Now that you've modified your host file, test your domain to make sure it's being pulled through Fastly's network. To test your domain, restart your browser then enter your domain in the address field. You should now see the updated domain in the address field indicating requests are being sent to the Fastly POP.

Alternatively, you can test the domain using a ping command to verify that your domain is being served by a Fastly POP address. In this case, `ping www.example.com` would display the Fastly POP address `151.101.56.204`.

> **IMPORTANT:** Be sure to remove the Host entry from your hosts file after you make CNAME changes to point your domain to Fastly.

## What's next

When you're ready to route production traffic through Fastly, [update your domain's CNAME record](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-cname-records-and-your-dns-provider) to begin routing client traffic through Fastly services instead of directly to your origin.
