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:
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 'www'.
You can create subdomains in Porkbun using our Manage DNS feature.
- 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.
- Locate your domain and click the "Details" button list to the right. In the domain Details area that appears, click the "Edit" option next to "DNS Records".
- If you won't be using Porkbun’s own web hosting or URL forwarder, you may wish to delete the default DNS records that point at 'pixie.porkbun.com' or 'pixie-parking.porkbun.com' by selecting the trash can icon.
- Select the record type you would like to add from the "Type" drop-down, then enter the hostname, aka the subdomain, and answer for the record. Click the "Add" button to add the record to DNS.
- Here's an example of what a subdomain DNS record might look like:
Depending on your web host and their instructions, you may need to create a CNAME record in order to set up your subdomain. If you want a subdomain to forward to a URL, 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.