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.

Uploading / Restoring Huge WordPress Sites with All-in One WP Migration

 Migration of WordPress site's are easy, thanks to plugins like All-in One WP Migration however if your site happens to be very large then migrating it can be difficult or next to impossible. 

For starters the plugin All-in One WP Migration limits the upload file size of a backup, but that can be removed by purchasing their Unlimited Extension, I would recommend you do that, but if you still want to be able to upload large backup files check below. 

Disabling Future Dates in WPForms Date Time Field

 WPForms gives us the ability to disable selection of dates in the past however if you want to restrict dates in the future there isn't an option available for the field in the user interface.

That's not impossible to do but you will have to use a bit of jQuery to achieve that. And we will show you how. 

Why I don't upgrade to WordPress

 It's been over a decade of StramaXon, and since I started blogging on things I learn, do and want to share with people. Blogger was the first choice back then, it was free and what else can be a better deal breaker for a young student to start his own website. 

Years have passed, WordPress is now more popular than ever and I in my professional career have built many many WordPress websites and I am totally aware of its pros and how well you can manage everything. 

So why I don't move to WordPress ?

I have given that a thought, I worked on wireframes and designs for a fresh new version of StramaXon on WordPress but dropped it later. 

It's the nostalgia. The nostalgia  I have for Blogger platform is beyond anything. StramaXon is one of the oldest work from the beginning of my work in this field that's still continuing, albeit not as paced as it used to be back in 2012-2015 but I still love to regularly write a few bits every now and then. 

Maybe in the future I change my mind and archive this blog and move to WordPress but for now Blogger is what I am sticking to. Probably will do some minor design updates, make some performance improvements and so on. 

Thanks for reading and subscribe to this blog for blogs on new topics I am working on these days

Conditionally loading JS & CSS Files in WordPress / WooCommerce sites for Better SEO

The score you get on Google PageSpeed Insight tool is a major factor for your website or e-commerce site's search engine ranking, but if you are on WordPress, especially with WooCommerce it is possible your scores are pretty bad. 

Getting OAuth Authentication Right for WooCommerce REST API

Recently I had to work with the WooCommerce REST API to do stuffs with products, mainly create / update it. However with its OAuth 1.0 authentication I couldn't get it just right. The REST API returned authentication error messages. 

Unable to Import Products CSV in WoocCommerce - 500 Internal Server Error

 Setting up a store but now you are stuck with the CSV import of your products? It happens and its frustrating when the error is not very descriptive. 

I faced a similar issue and after a lot of digging found a solution for the issue I was facing. 

Page List widget configuration not working on Save - javascript:void on click

 If you are trying to add / edit the "Pages" widget on your Blogger blog's layout you may have noticed that it isn't working lately. 

Show random product suggestions on Checkout page in Shopify

An "Add more to cart" module on the Checkout is a great way to increase the amount of products your customers buy, Checkout page can be a great place for showing a few more products that your customers may want to add to their carts. 

Fixing WordPress Website Infected by .ico Malware

 More cases of WordPress websites being infected by .ico Malware are showing up and it is a difficult job to get rid of it completely and make sure site safe again, but it's not impossible.