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. 

Getting Rid of WordPress Malware (.ico Backdoor Malware)

Recently major malware campaigns on WordPress were launched, infecting and exposing vulnerabilities in many popular plugins which effectively affected hundreds of thousands of WordPress sites.

In this post we talk about a malware that affects the site by injected malicious .ico files at random locations, as well as index.php files and code snippets in core WordPress files.


Show A COVID-19 / Corona Virus Update Message on your Blogger Blog

The World is in a lock-down, we are all aware of it. Due to many factors you may want to show some message on your Blogger.com blog to notify your readers about what's going on for you.


Solving "Preload key requests" point on PageSpeed for WordPress sites

Getting a good score on Google PageSpeed is important if you want to rank higher and in the process provide a better experience to your users. However with the constantly updating system of PageSpeed you have to tackle new issues. One of the recent updates now focuses on preloading key requests on your site.


A Review of the Blogger App for Android

Used and loved by millions of bloggers and content creators around the World, it is just very natural and obvious for Blogger to bring out an Android App to let its users to what they love on the go, but is it really worth the install?

Multiple Descriptions Tab for Shopify Product Pages without any Apps

It's a very common practice for e-commerce websites to have not just a single description text under your product but more than that, each part of description categorized under different tabs.


Setting up InspectorControl with Color Selection in Gutenberg | Gutenberg Series

If you have recently gotten on the bandwagon and have been trying out your hands with the Gutenberg editor and its developer interface then you may have spent good amount of time on already learn about the editor and creating your own blocks.

This tutorial however is not about creating blocks, I assume you have already created a block and now are looking to add option for the user to control color of something in your block, for e.g the background or text color.

I will write an article on creating an editable Gutenberg block from scratch using the best practices.


Redirecting HTTP to HTTPS in Magento 2 for Bitnami AWS Stack

Recently while setting up a Magento 2 store on AWS using Bitnami's Magento Stack I ran into the problem of HTTPS redirection, while visiting the site with http:// it wouldn't redirect to the https:// version, even after searching for solutions on official docs, nothing worked, however I found a simple solution that did the trick.

Add Happy New Year Message to your Blog 2018

The new year is hours away, why not celebrate the joy of the welcoming the year 2018 with the ones who visits your blog?

Let's put a smile on everyone's faces who visits your blog by wishing them a happy new year when they open your website up for the first time.


New Year, A New Beginning for StramaXon and Me

I started this blog back in the year 2011 when I was still a young enthusiast who had a craze for creating, creating just about anything that he found to be useful for people, to share what he knew and to help and connect with people.


Trouble Adding AdSense Code for Page-Level Ads? Learn how to fix it.

In order to add the Page-Level ads functionality from AdSense on your Blogger blog you are required to place a code that AdSense provides which is :

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"/>

Unfortunately if you have tried placing the code in your theme you may have run into this error that states:

Error parsing XML, line n, column n: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.