So, you want to connect your Porkbun domain to a third-party site, but they don’t provide an IP address—but they do provide a host name. No problem! We have two possible ways we can do it: via CNAME flattening (aka ALIAS records) or via URL forwarding. We’ll cover URL forwarding later in this article.
CNAME flattening (ALIAS record) method
Use this method if your web server will respond to requests for your root domain. If your web host wants you to instead URL forward the root domain to www, skip ahead to the next section.
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.
Click the Details drop-down list, and select “Edit” next to DNS Records.
Now we’ll add the “ALIAS – CNAME flattening” record. This record will have a blank host field. The answer will be the host name provided by your hosting company.
Now we’ll add a CNAME record, with the Host field set to “www” and the Answer set to the host name provided by your company.
In the end, you should have an ALIAS record for the root domain, and a CNAME record for the subdomain.
URL Forwarding method
If your web hosting company specifically requests you forward your root domain to “www” here’s how to do it:
Log in. You should arrive at the Domain Management screen. If you’re already logged in, click your username in the top-right corner and select Domain Management.
Click the drop-down list to the far right of your domain. Then click the “Edit” option next to URL Forwarding.
From there, enter http:// or https:// followed by www. your domain.4
Now we want to delete the “wildcard” record that was created. This is an A record that has an asterisk (*) in the Host field. To do this, return to the Details menu, and select “Edit” next to DNS Records.
Locate the record and delete it. To do this, select the garbage icon to the far right. Don’t delete the one without the asterisk.6
Once deleted, replace that record with a CNAME record. This record will have “www” in the host field. The answer will be the host name provided by your hosting company.
That’s it! Now, if someone types in http://yourdomain example in their browser, it will URL forward on to https://www yourname example and the CNAME record will send the browser to the IP address of your web server.