How to Bulk Add DNS Records in Squarespace Using the Browser Console

Note: This article was heavily assisted by AI. The underlying technique, testing, and implementation were done by me; I used Claude to help refine the process and turn my notes into a cleaner write-up.

Squarespace’s DNS interface works well when you only need to add a few records. But when you have dozens of CNAME and MX records to enter, adding them one at a time through the UI becomes slow very quickly.

A much faster approach is to call the same internal DNS endpoint that Squarespace’s own interface uses, directly from the browser console. The request still runs through your authenticated Squarespace session, so you are not bypassing account permissions—you are simply avoiding the repetitive one-record-at-a-time UI.

How it works

First, log into Squarespace and open the DNS settings for the domain you want to update.

Open your browser’s DevTools and switch to the Network tab. Then manually add a single DNS record through the normal Squarespace interface.

Look for a request similar to this:

POST /api/account/1/domains/{DOMAIN_ID}/dns/v2/dns-bulk-changes

The important part is the {DOMAIN_ID} in the request URL. This ID is unique to the domain, so do not reuse one from another domain or account.

You will also need the CSRF token from the request headers. You can find it in the cookies using the Google Chrome Dev Tools, it may be called "crumb"



Once you have both values, you can use the following helper function from the DevTools Console:

const CSRF_TOKEN = "PASTE_YOUR_TOKEN_HERE";

async function addDnsRecords(records) {
    const res = await fetch(
        "https://account.squarespace.com/api/account/1/domains/{DOMAIN_ID}/dns/v2/dns-bulk-changes",
        {
            headers: {
                "accept": "application/json",
                "content-type": "application/json",
                "x-csrf-token": CSRF_TOKEN
            },
            body: JSON.stringify({
                recordsToAdd: records,
                recordsToRemove: [],
                presetsToAdd: [],
                presetsToRemove: []
            }),
            method: "POST",
            credentials: "include"
        }
    );

    const json = await res.json().catch(() => null);

    console.log({
        status: res.status,
        ok: res.ok,
        response: json
    });

    return {
        status: res.status,
        ok: res.ok,
        response: json
    };
}

Replace {DOMAIN_ID} with the actual domain ID you captured from the Network request.

Adding multiple DNS records

Once the helper function is loaded, you can submit multiple records in a single request:

await addDnsRecords([
    {
        type: "CNAME",
        domainName: "example.com",
        subdomain: "em1234.location",
        ttl: 14400,
        hostname: "example.sendgrid.net",
        priority: ""
    },
    {
        type: "MX",
        domainName: "example.com",
        subdomain: "location",
        ttl: 14400,
        hostname: "mx.sendgrid.net",
        priority: "10"
    }
]);

Also on Github Gists:

A few important details

The subdomain value should contain only the hostname portion before the main domain.

For example:

em1234.location.example.com

becomes:

em1234.location

For MX records, Squarespace expects the priority as a string:

priority: "10"

For CNAME records, the priority can remain empty:

priority: ""

The ttl value is specified in seconds. For example:

14400 = 4 hours
3600  = 1 hour
1800  = 30 minutes

Use smaller batches

Even though the endpoint can accept multiple records at once, I would not recommend pushing a very large DNS change in one request.

For larger jobs, batches of roughly 10–15 records work well. Smaller batches make it easier to verify each change and reduce the impact if there is a typo or an issue in the source data.

Also keep these arrays empty unless you specifically intend to modify or remove something:

recordsToRemove: [],
presetsToAdd: [],
presetsToRemove: []

That way, each request is limited to adding the records you explicitly provide.

Verify everything

Before making any changes, take a snapshot or export of the existing DNS records.

After each batch, inspect the API response and confirm that the records you submitted appear with the correct:

  • Record type
  • Subdomain
  • Target / hostname
  • MX priority
  • TTL

Once all batches are complete, compare the final DNS state against both your original spreadsheet and your pre-change DNS snapshot.

Why this is useful

I used this method on a project that required 92 DNS records across 23 locations.

Doing that through Squarespace’s standard Add Record interface would have meant repeating the same sequence 92 times. Using the bulk endpoint allowed the records to be normalized, reviewed, submitted in manageable batches, and verified after each request.

This approach does not bypass Squarespace authentication, permissions, or 2FA. The request runs using the browser session you are already authenticated with and calls the same backend endpoint used by Squarespace itself.

For large DNS migrations, SendGrid setups, email-authentication rollouts, or similar projects, this can turn a very repetitive task into a much more manageable workflow.