Ultimate WordPress DNS Configuration Guide: DNS (Domain Name System) is one of the essential website management aspects every developer needs to know about.
Understanding what each element within the DNS does and how it affects other parts is crucial, especially if you plan to manage, move, or redirect your domains.
Researching these systems with the help of resources like Hosting Wiki will help you better understand web hosting, domain management, and other WordPress tools that are a must for any successful site.
Let’s dive deep and learn more about Domain Name Systems.
👇Ultimate WordPress DNS Configuration Guide 👇
What is DNS?
DNS is a system that allows you to point a domain name to an IP address. A domain name is the combination of a label and a top-level domain you chose for your website.
For instance, www.wikipedia.com is Wikipedia’s domain with “Wikipedia” being the label, and “.com” acting as the top-level domain.
When you enter the domain into your browser, the DNS will resolve it to the IP address where that name is hosted.
A DNS makes managing domain names more convenient as it allows the use of memorable names instead of numeric IPs.
It also makes it possible to change hosting services without necessarily having to change your domain name.
Before you accomplish anything with a DNS, you must first own a domain name. Several companies offer domains, which you can usually renew annually.
Once you have a domain name, you need hosting – a place to store your site’s files, making them available for access under your chosen domain.
You can purchase domains and hosting services from the same provider or use one company for the domain name, and another for hosting. It is all a matter of preference.
Managing Your DNS and Domains
The DNS provides you with the tools needed to manage and control where your domain names point to.
When purchasing a domain name or hosting service, make sure you choose companies that give you full access to DNS records.
Usually, you will have access to your DNS interface via your provider's website or control panel.
Once logged in, there are a few basic concepts you should learn how to use. These include:
1. Name Server
Each domain name comes with at least two name servers, so when one fails, the second one can take over. A name server keeps the records of your DNS entries.
WordPress hosting providers often allow users to change or customize their name servers so you can have yours as NS1.example.com
and NS2.example.com. A name server can point your entire website (domain names, emails, FTP) to another provider.
2. A Record
An A record allows you to direct your domain to a separate IP address other than the one your provider issues.
This only affects your website’s pages and not the email accounts hosted within that domain.
3. CNAME Record
A CNAME record allows you to point to a domain name instead of an IP address. For instance,
if you want to point a subdomain to your main domain the CNAME will be what you’ll have to use.
It will map an address like www.example.com to the main domain example.com
4. MX Record
Mail Exchange (MX) records specify the server where you have your emails hosted.
This DNS resource allows you to add a mail server to handle emails through a domain-based email account. Once set up,
this record helps create a custom address like [email protected]
TXT records provide human-readable information associated with your host, domain name, network, and more.
Domain Redirecting, Add-ons and Parking
If you keep all your domains on the same servers provided by your domain name registrar or hosting, you probably won't need to make any changes.
However, if you have more than one domain pointing to the same site, use a different hosting provider from your domain registrar or prefer domain mapping via WordPress Multisite,
then you should know how to redirect your domains.
Redirecting a Domain
Each hosting provider has its unique interface and tools for redirecting one domain to another domain.
You can use the CNAME-record to redirect to a domain name or an A record to point to an IP address.
Your hosting provider’s control panel will have tools for redirecting domains within the interface.
If you happen to use cPanel, here’s how you redirect your domain name.
- Log in to your cPanel dashboard. Next, navigate to Domains -> Redirects.
- You’ll see several boxes that you need to fill in, such as:
- Type — you have to choose between permanent redirects (301) or temporary redirects (302). The former will alert the user’s browser to update the bookmark to the new address while the latter won’t do that. The default option is permanent (301), however.
- https://(www.)? — You must pick up the domain name that you want as a redirect. You can also select All Public Domains if you want to redirect all addresses.
- / (forward slash)— fill in this box if you wish to redirect a specific file to your new domain.
- Redirects to — it requires you to specify the new domain name that people will be forwarded to.
- www. Redirection — select whether the user will be redirected when they use www., non-www., or both versions of your website.
- Wild Card Redirect — enable this option if you want to redirect all pages from your old domain to the new domain.
3. After you’ve entered all the information, don’t forget to click the Add button.
Creating Add-on Domains
Add-ons are the additional domain names you use along with your primary domain. You can use them to create another website,
which is convenient if you want to run multiple sites without necessarily investing in a separate hosting account for each.
You can create add-ons from your cPanel, which automatically creates a sub-directory.
However, you will need to install WordPress on the sub-directory to resolve the add-on separately to your root domain.
The biggest benefit of add-on domains is the ability to manage them from a single control panel.
How to Change Your Nameservers
- To change your nameservers, you have to log in to your domain registrar first.
- To change your nameservers, you have to log in to your domain registrar first.
- Change those nameservers to the new ones and then hit Update. Keep in mind that it might take 24 hours before your DNS fully propagate worldwide.
In this WordPress DNS Configuration, Domain parking allows you to point your domains to one single website.
You can enable this feature in your hosting provider’s control panel.
This is perfect if you’re using multiple domains for different locales and want to point them to the same site.
How to Point a Domain Name
Before we begin WordPress DNS Configuration, make sure that there is already a website hosted on your IP address.
This will prevent visitors from visiting a blank page after the DNS record has been updated.
Here, we’ll be using the cPanel again to point a domain name to an IP address. Nonetheless, the steps are generally the same almost everywhere.
Access your cPanel and head to Domains -> Zone Editor. After that, click Manage on the right side of your desired domain name.
- To point your domain name to a new IP address, click Add New. You have to enter several details:
- Name — your domain name.
- TTL — Time To Live. It defines how long before the servers refresh the DNS details. The default value is 14400.
- Type — the record type. Since you want to point to an IP address, select A.
- Record — your new IP address.
After this, you can delete the records that point to the old IP address
- Typically, you will need to have two A records, the first with www and the second without. By doing this, the readers will visit the new website either way.
Domain Emails and Tracking
It is often recommended to use a different service for emails, such as G Suite or Flock. They provide you with a better interface and are separate from your main website.
That means if your site is experiencing issues and can’t be accessed, you can still get emails.
It is also essential to track your domains to determine whether your domains are resolving as you intended. This will help avoid any bad actors trying to use your domain to point to scam sites or similar low authority domains.
I hope you will like this WordPress DNS Configuration, The DNS can be intimidating.
However, like everything else tech-related, it takes practice and continuous learning to become an expert.
Understand the domain name system and its features will put you on the right track to becoming a better webmaster.