How to create a subdomain

In the Domain Name System hierarchy, subdomains are domains that are part of your root domain. Using our handy graphic of the anatomy of a URL you can see where the subdomain is: 

Diagram showing WWW subdomain

Subdomains can be used to navigate to different sections of your website. For example, if you wanted to have your online store as part of porkbun.com, you could create a subdomain shop.porkbun.com that points at an online store you set up.

The most common subdomain you see is "www". Web hosts will often have you put in two DNS records, one with the hostname blank and one with the hostname set to "www".

You can create subdomains in Porkbun using our Manage DNS feature.

1
Log in. You should arrive at the Domain Management screen. If you're already logged in, click on ACCOUNT in the top-right corner and select Domain Management.

2
Locate your domain and click the "Details" button list to the right. In the domain Details area that appears, click the edit icon next to "DNS Records".

DNS Records menu on Domain Management page

3
If you won't be using Porkbun’s own web hosting or URL forwarding tools, you may wish to delete the default DNS records that point at 'pixie.porkbun.com' by selecting the trash can icon.

Default DNS records that you may need to delete

4
Select the record type you would like to add from the "Type" drop-down, then enter the Host name (AKA the subdomain) and answer/value for the record. Click the "Add" button to add the record to DNS.
Here are a couple examples of what a subdomain DNS record might look like: 

A record subdomain example

CNAME subdomain record example

⚠️️  Note

You need something to "point" your subdomain to in order to create it in DNS. This will typically be the IP address or URL given to you by your hosting provider when you're setting things up.

That's it! Once you've created the record, your subdomain is automatically created in the DNS for your domain, and that subdomain should start resolving within 24 hours.


If you want a subdomain to redirect to a specific URL instead, you can use our How to set up URL forwarding guide to set the subdomain up.

If you are using our static hosting service with your domain, you can also reference our How to set up subdomains in the Static Hosting guide to set up a subdomain in your static hosting environment. This will automatically reflect in your DNS.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.