DEV Community 👩‍💻👨‍💻

Joel Varty
Joel Varty

Posted on

DNS 101 For Web Developers

As web developers, DNS is one of the least understood aspects of the internet. It's also one of the most important, as it's the glue that links your domain name ( to your website that's hosted on a web server.

DNS stands for Domain Name Service

What we are talking about here is the ability for people who are browsing the internet at your web address to be directed the IP Address of the server that is hosting your website. It connects the Domain Name, to the IP Address. An IP Address is a series of 4 numbers between 0 and 255 that each web host should be able to give you.

There are a few different ways that we can achieve this.

The "A" Record

This is the most basic type of record. It says point this address ( to this IP Address (

For each top-level domain you should have 1 A Record. That should be used to connect your top-level website address to your web hosting IP Address.

Resist the temptation to create A records for all your subdomains (,, That way lies madness! Why? If you ever move web hosts, you don't want to have to change all these A records!

We can use a different method for those.

The "CName" Record

A CName points one web address ( to another one ( The most common usage of this is to send traffic from your subdomains (eg: to your top-level domain (


Many tools use the @ symbol to represent your top-level domain.

www @

In other situations, you need to point a subdomain (eg: to another address given to you be an address given to you by online service, such as Netlify, Cloudflare, or Azure CDN.


Notice that some DNS providers require you to add the dot (.) after the address you are pointing other, otherwise they will create a link between subdomains ( -> which is not what you want.

The "TXT" Record

Normally, a TXT record is used to verify that you own a domain. You will be asked to put a unique identifier your TXT record that is provided by the service.

Other DNS Record Types

There a many other DNS record types (MX, SPF, etc.) As a web developer you probably won't need to work with those very often. If you do, let me know in the comment.

Name Servers

DNS Records can be hosted separately from your actual DNS name. They are hosted by your Name Servers. There are usually 2, sometimes 3 of these to provide redundancy. When you setup using some hosting services, they will ask you to point to their name servers. That way they can help you with common settings for their service.

This can become confusing if you've setup all your DNS records in one spot, but have indicated on your actual DNS host to point to name servers - so be sure to document that somewhere.


This is getting beyond the scope of this article, however there are a view tools you can use to check what the DNS settings are for a particular domain name.

Use ping to check A record (IP Address) or CName

Enter fullscreen mode Exit fullscreen mode

Online tools such as can also tell you where your DNS settings have been propagated to worldwide.

I hope you find this helpful!

Oldest comments (8)

pim profile image
Pim • Edited on

Amazing article and such an important subject that is often looked past. Also important to do a DNS Leak test!

ineedale profile image
Alex Leonhardt

Just the title reminded me of :)

andreasjakof profile image
Andreas Jakof • Edited on

Since IPv4 is considered "historic" for a while now, there is another record type, which is becoming more and more important:

AAAA Records are much like A Records, but instead of using IPv4-Addresses, they map the name to an IPv6 Address.

andreasjakof profile image
Andreas Jakof

Just for some comparison of address space between IPv6 and IPv4

IPv4: 2^32  =                                       4,294,967,295 
IPv6: 2^128 = 340,282,366,920,938,463,463,374,607,431,768,211,456
joelvarty profile image
Joel Varty

Agreed! This is going to be more and more important moving forward!

chrisrhymes profile image
C.S. Rhymes

Top tip, if you transfer your domain, remember to set your dns settings on your new provider... 🤦‍♂️(speaking from personal experience)

Also I found using dig a useful tool to see where domains redirect to.

joelvarty profile image
Joel Varty

Nice tip!

syntaxseed profile image
SyntaxSeed (Sherri W)

This is great! Would love to see a follow up with the other record types.

The Complete Guide to Full Stack Web3 Development

>> Check out this classic DEV post <<