Working with domains

      Last updated August 21, 2019

    Domains are used to route requests to your service. You associate your domain names with your origin when provisioning a Fastly service, and you can add, edit, or remove domains from your service at any time.

    Creating a domain

    Follow the steps below to add a domain to your service:

    1. Log in to the Fastly web interface and click the Configure link.
    2. From the service menu, select the appropriate service.
    3. Click the Edit configuration button and then select Clone active. The Domains page appears.

      the Domains page

    4. Click the Create domain button. The domain creation fields appear.

      the Create a Domain page

    5. Fill out the domain creation fields as follows:

      • In the Domain Name field, type your domain name. The domain name is used to properly route requests to your website, and ensures that others cannot serve requests to that domain. For example, you could enter,, or even use wildcards such as *

      • In the Comment field, optionally type a comment that describes the domain.

    6. Click the Add button. Your new domain appears in the list of domains.
    7. If you haven't already, add CNAME DNS records for your domain name to begin routing client traffic through Fastly services instead of directly to your origin.
    8. Click the Activate button to deploy your configuration changes.

    Using the API

    You can use Fastly's API to programmatically add domains to your service. To add a domain to your service, make the following API call in a terminal application:

    curl -H "Fastly-Key: FASTLY_API_TOKEN" -X POST<service_id>/version/<version_id>/domain -d ''

    The response will look like this:

      "comment": "",
      "name": "",
      "service_id": "<service_id>",
      "version": <version_id>

    Domain creation limits

    We set a limit on the number of domains you can create per service by default. However, if you email, we may be able to adjust this number for you by working with you to set up and fine-tune domain handling in your service.

    Testing a domain

    You can test a domain to see how your service is being pulled through our network. This can help you identify DNS issues and problems with your Fastly configuration. See our testing guide for instructions.

    Deleting a domain

    Follow the steps below to delete a domain from your service:

    1. On the Domains page, click the trash icon next to the domain you want to delete.
    2. Click the Confirm and delete button to confirm you want to delete your domain.
    3. Click the Activate button to deploy your configuration changes.
    Back to Top