Ashwin S.23 Oct 2026Domains & DNS9 min read

How to Setup DNS

On this page

About to configure the DNS for your website or email server? You've landed in the right place. In this guide, you'll learn a simple, straightforward way to set up DNS from your dashboard. Even if you have no prior experience, the steps are easy to follow and will help you get things up and running quickly.

The steps are general, so they work in the DNS area of most hosting and domain dashboards. The labels and buttons may differ a little from one provider to the next. Don't have a domain yet? HostAfrica sells .eg domains, along with .africa, .com and many other extensions. See them on our domains page.

Prefer video? Watch a DNS setup walkthrough on YouTube.


What You Need Before Setting Up DNS

Here are the prerequisites for setting up DNS:

  • A registered domain name: You'll need an active domain that you own or manage.
  • Access to DNS settings: You must be able to reach the DNS settings in your hosting provider or domain registrar account.
  • IP address of your web server: This is where your domain will point, so you'll need the correct IP address from your web hosting provider.
  • Name server information: If you're using third-party DNS hosting, you'll need the name servers that service gives you.
  • Email server details (optional): If you're setting up email for your domain, gather the mail server information, such as the MX records.
  • DNS record information: For every DNS record you create, you'll need to know:
    • Record type (the type of DNS record)
    • Host name (the subdomain or host name)
    • Points to (the IP address or domain name the record should point to)
    • TTL (Time to Live, the amount of time before a DNS client should query the server again for the same record)

Steps to Setup DNS

With the prerequisites sorted, we'll now turn to the business end of this guide: how to set up DNS. This section walks you through the whole process.

Find Your Domain Registrar or Hosting Provider

First, find out where your domain is registered or hosted. Here's how:

  • Check your email: Look for the confirmation email from when you bought your domain. It usually names your domain registrar.
  • Use a WHOIS lookup: If you're unsure where your domain is registered, use a WHOIS lookup tool. It shows the domain registrar and contact information.
  • Log in to your hosting provider account: If your domain is managed through your hosting provider, sign in and go to the "My Domains" or "DNS Settings" section.

Not sure what a registrar does? Our guide to what a domain registrar is explains it.

Access the DNS Management Dashboard

Next, open the DNS management area:

  1. Visit the website of your domain registrar or hosting provider and sign in.
  2. Look for a section such as "Manage Domains", "Domain Management", "DNS Settings" or similar, depending on your provider.
  3. Here, you should be able to view and update your DNS records.

Understanding DNS Records

As you learn how to set up DNS, you'll come across different types of records that control how your domain connects to different services. Here's a quick overview of the most common ones:

  • A record: Points your domain to an IP address. It connects your domain name to your website's server.
  • CNAME record: Points one name to another. For example, you may use it to send www.yourdomain.eg to yourdomain.eg.
  • MX record: Used for email. It tells email servers where to deliver messages sent to your domain.
  • TXT record: Used to verify domain ownership or improve security, for example for email authentication.

Adding A and CNAME Records

Here are the steps to add an A record:

  1. Open the DNS management area of your dashboard.
  2. Select the zone (the domain) where you want to add or change records, and open it for editing.
  3. Once the zone is open, you should see an option to add new records.
  4. Choose to add a new record and select "A" from the list of record types.
  5. Enter the host name. Usually you use "@" for your main domain (for example yourdomain.eg), or enter a subdomain if needed.
  6. Add the IP address of the web server the domain should point to.
  7. Leave the TTL at its default value unless your provider says otherwise.
  8. Double-check the details and click "Save" to update the record.

For CNAME records, follow these steps:

  1. Choose "CNAME" from the list of record types.
  2. Enter the alias. For example, enter "www" to point www.yourdomain.eg to yourdomain.eg.
  3. Add the domain name the alias should point to, such as yourdomain.eg.
  4. Again, leave the TTL at the default setting unless told otherwise.
  5. Check that everything is accurate and save your CNAME record.

A note on accuracy:

Enter everything correctly, especially IP addresses and domain names. A single typo can stop your site or services from working. Always double-check before saving.

Setting Up MX Records for Email

MX (Mail Exchange) records send the email for your domain to the correct mail servers. Take care when you set them up, because a mistake can lead to lost emails or failed deliveries. Here are the steps:

  1. In your DNS settings, find the option to add a new record, as you did for the A and CNAME records.
  2. Choose "MX" from the list of record types.
  3. Enter the mail server details:
    • Host name: Usually you leave this blank or use "@" for your main domain.
    • Mail server address: Enter the mail server your email hosting service gives you, for example mail.yourdomain.eg.
  4. Set the priority. A lower number means a higher priority. The first MX record usually has the lowest number, and each backup record a higher one.
  5. Leave the TTL at the default setting unless your provider suggests otherwise.
  6. Double-check that everything is in order, then save.

Adding TXT Records for Verification

TXT records are often used to verify domain ownership or improve security, especially when you set up services such as Google Workspace or Microsoft 365. Here's how to add one:

  1. Open the DNS management area for your domain. On a hosting account, this sits in your hosting control panel. HostAfrica web hosting uses DirectAdmin.
  2. Select the domain you want to add the record to. You should now see all the DNS records for that domain.
  3. Choose to add a new record.
  4. Select "TXT" as the record type.
  5. Leave the name field blank, use "@" for the main domain, or enter a subdomain, as the service you're setting up asks.
  6. In the value field, paste the verification code or text string from the service you're setting up (for example Google Workspace or Microsoft 365).
  7. Leave the TTL at its default value unless you're told to use a specific time.
  8. Double-check the details, then save the record.

Propagating DNS Changes

When you change your DNS settings, it takes time for the update to reach DNS servers around the world. This process, known as DNS propagation, can take up to 24 to 48 hours.

Why does it take time?

There are two reasons:

  • Caching: DNS servers cache information to speed up lookups. When you make a change, those caches need to refresh, and the timing varies by server.
  • Global spread: Your DNS changes need to reach servers around the world, and the speed at which that happens can differ.

How to track DNS propagation?

Here are a couple of tools you can use to check DNS propagation:

  • WhatsMyDNS: Enter your domain and record type to see how the change is spreading across locations worldwide.
  • DNS Checker: A similar service that checks DNS propagation from many servers around the globe.

Common DNS Setup Mistakes to Avoid

It's easy to make mistakes while configuring DNS, especially while you're still learning. Here are some common errors and how to avoid them:

Entering incorrect IP addresses

Mistake: Using the wrong IP address in an A record can make your site unreachable.

Avoid: Double-check the IP address from your hosting service and enter it carefully.

Misconfiguring records

Mistake: A misconfigured CNAME, MX or TXT record can cause problems with email delivery or domain verification.

Avoid: Follow the steps above along with the specific advice from your service provider. Use the correct values and check for typos.

Forgetting to update TTL

Mistake: A TTL value that is too high can delay your changes.

Avoid: Set a lower TTL if you're making frequent changes. You can raise it again once the changes are confirmed.

Overlooking record priorities

Mistake: Wrong priority settings on MX records can affect email routing.

Avoid: Set the priority numbers your email service provider specifies.

Not saving changes

Mistake: Forgetting to save after making changes means no update is applied.

Avoid: Always confirm and save your changes before you leave the DNS management dashboard.

Selecting the wrong record type

Mistake: Choosing the wrong type of record (for example adding an A record when a CNAME is needed) can break things.

Avoid: Check which record type you need in the instructions from your hosting or email service, and select the right one from the list.


Testing and Verifying Your DNS Setup

After you set up DNS, check that everything is configured correctly. Here are some tools you can use:

WhatsMyDNS

  • Go to the website.
  • Enter your domain name in the search box.
  • Select the type of DNS record you want to check (for example A, CNAME or MX).
  • Click "Search" to see whether your changes have spread worldwide.

DNS Checker

  • Visit the site.
  • Enter your domain name and select the record type.
  • Click "Search" to check the status from many locations around the world.

MXToolbox

  • Go to the website.
  • Enter your domain name and choose "DNS Lookup" from the list.
  • Click the "DNS Lookup" button to see the results.

How to Update DNS in the Future

DNS configuration isn't a one-time task. As your online needs change, you may need to update your DNS settings. Here are some common reasons to revisit them:

  • Website migration: If you move your website to a new hosting provider, update the A record with the IP address of the new server.
  • Adding subdomains: To create a subdomain (for example blog.yourdomain.eg), add a new CNAME or A record that points to the right destination.
  • Changing email providers: If you switch email services, update your MX records with the details of the new mail servers.
  • Security updates: Sometimes DNS records need updating to fix a security weakness or add a new security measure.

How to update DNS records?

Here are the steps to update your DNS configuration:

  1. Open the DNS management dashboard at your domain registrar or hosting provider.
  2. Find the records you need to update (for example A, CNAME or MX).
  3. Click the record you want to change and update the details (for example a new IP address or mail server).
  4. Save to apply the changes.
  5. Use a DNS checking tool to confirm that the update is spreading correctly.

Changing the name servers of a .eg domain

A .eg domain has one extra step to plan for. The .eg registry asks for a primary and a secondary name server, with their IP addresses, when the domain is registered. According to the registry's page on modifying technical data, a later name server change goes to the registry on a signed form, and the registry processes it within two working days. Allow for that time on top of normal DNS propagation.


Conclusion

A properly configured DNS setup keeps your website and email available and working smoothly. We hope you found this guide easy to follow, and that you can now manage your DNS setup with confidence. If you ever need more information about a domain, try HostAfrica's WHOIS lookup tool.

Find the perfect domain name

Search and register your domain in seconds, with free DNS management.

Avatar for Ashwin S.

Ashwin S.

The Author

Ashwin is a content specialist at HostAfrica, where he's been crafting clear, authoritative copy since 2021. With a background in digital marketing and a passion for impactful storytelling, he turns complex ideas into trustworthy, engaging content. Ashwin writing helps our audience navigate web hosting and cloud solutions with confidence.