Automatically configure DNS based on customer plan

If you offer more than one product or plan — say, a standard site builder and a more advanced one — each might need different DNS records pointed at your service. You can automate this entirely, so the correct DNS is applied the moment a customer registers a domain, with no manual setup and no code required on your end.

This combines two Storefront features: DNS Templates, which define a reusable set of DNS records, and Querystrings, which let you specify which template to apply before the customer even starts checkout.

How it works

Imagine you offer two plans with different DNS requirements:

  • Standard Site Builder — needs an A record at the root and a CNAME at www pointing to your service
  • cPanel Web Hosting Plan — needs a different set of records

You create one DNS Template per plan in Storefront Manager, each with a clear, human-readable name (this name is also what the customer sees if they ever choose to reset their DNS).

Set it up

  1. In Storefront Manager, create a DNS Template for each plan, with the records that plan requires.
  2. Open the template's details and find Apply this template using a link. This gives you the Template ID and a ready-made link with the query string already attached.
  3. Use that link (or build your own using the Template ID) wherever you send customers to your Storefront — for example, a "Get a Domain" button inside your own product that already knows which plan the customer is on.

https://yourwebsite.com?dnstemplateid=7161d6b2-84cc-44df-93fc-69ef6c75bd9e

What happens

When a customer arrives via that link, Storefront stores the Template ID in their session. The moment they complete a domain registration, Storefront automatically applies every record from that template to the new domain — no manual DNS setup, for you or the customer.

The applied template is shown on the domain's details page, and can be changed or removed manually in Storefront Manager if needed.

Combine it with a customer ID

You can stack a extuserid query string onto the same link to also tag the customer with your own internal ID at the same time:

https://yourwebsite.com?dnstemplateid=7161d6b2-84cc-44df-93fc-69ef6c75bd9e&extuserid=your-internal-id-123

See Link Your Own Customer ID to Storefront for more on this.

Related articles


Did this page help you?