After you deploy your service, but before you change your DNS entries to send your domain to our servers, you can check to see how your service is pulled through our network. Testing your domain can help you identify DNS issues or problems with your Fastly configuration.
Using the web interface
To use the web interface to test your domain on Fastly before you make a final CNAME change, follow the steps below:
- Log in to the Fastly web interface and click the Configure link.
- From the service menu, select the appropriate service.
-
Click the Edit configuration button and then select Clone active. The Domains page appears.
- Click the Test domain link next to the domain you want to test.
- Verify that your website appears in a new tab in your web browser.
Using command line utilities
To use command line utilities to test your domain on Fastly before you make a final CNAME change, you would:
- find the IP address of a Fastly pop
- add a domain Host entry to your hosts file
- test the domain in a web browser
Determining the IP address of a Fastly POP
Use the nslookup or dig command to determine the IP address of a Fastly POP.
TIP: For non-TLS requests, use nonssl.global.fastly.net
. For TLS requests, use the custom TLS CNAME record provided by Fastly support. For more information about the Fastly TLS service, see our guide on TLS service options.
For example, running nslookup for nonssl.global.fastly.net
returns:
1
2
3
4
5
6
7
$ nslookup nonssl.global.fastly.net
Server: 185.121.177.177
Address: 185.121.177.177#53
Non-authoritative answer:
Name: nonssl.global.fastly.net
Address: 151.101.56.204
Find the IP address at the bottom of the nslookup response. In this example, it's 151.101.56.204
.
Alternatively, running dig for nonssl.global.fastly.net
returns:
1
2
3
4
5
6
7
8
9
10
11
12
13
$ dig nonssl.global.fastly.net
; <<>> DiG 9.8.3-P1 <<>> nonssl.global.fastly.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35146
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;nonssl.global.fastly.net. IN A
;; ANSWER SECTION:
nonssl.global.fastly.net. 30 IN A 151.101.56.204
The IP address (A record) is in the ANSWER SECTION
of the dig results: 151.101.56.204
.
Modifying your hosts file
You can temporarily add a static IP address and domain Host entry to the hosts file on your computer. For example, if the domain you are testing is www.example.com
and one of the IP addresses returned by nslookup or a dig command is 151.101.56.204
, you would add this entry to the file:
1
151.101.56.204 www.example.com
and save the changes.
TIP: On machines running Mac OSX or Linux, your hosts file is /etc/hosts
. On Windows-based machines, it's C:\Windows\System32\Drivers\etc\hosts
.
Testing your domain
Test your domain to see how Fastly pulls it through our network by restarting your browser if it's already running, and then typing 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
.
Be sure to remove the Host entry from your hosts file after you make CNAME changes to point your domain to Fastly.