What is DNS? How does DNS work? Types of DNS Servers- Backend Development Series
- Gourav Dhar
- Dec 5, 2022
- 6 min read
Updated: Dec 9, 2022

Have you ever wondered what happens behind the scenes after you enter a URL in the browser? How does the browser know where to find the data belonging to a website?
The answer is DNS (Domain Name System). Without DNS, the whole internet framework would collapse. The internet is actually computers that are interconnected by lots of wires. The DNS is responsible for mapping these computers with the URLs.
If you are a software developer, a DevOps engineer, or a computer science student, you would need to know about how DNS works and this blog is for you.
Let's dive right in -
What is DNS? - Definition
What is DNS in computer networks?
DNS stands for Domain Name System. It is a system that allows us to find the IP address of a website or server.
DNS is a hierarchical naming system for computers, services, or other resources connected to the Internet or a private network.
The name "DNS" derives from its role as a directory for the Domain Name System (a tree-structured system). The DNS hierarchy consists of domains, which are collections of subdomains (e.g., "example.com" can contain "subdomain1.example.com", "subdomain2.example.com", etc.), and DNS records which map domain names to IP addresses and identify other information about those domains (e.g., which mail servers handle email for that domain).

How does a DNS query work?
The internet as we know it today is actually computers present somewhere in the world, and everything is interconnected using wires. Each computer is identified using a string of numbers called IP addresses. These IP addresses are unique to the computer/machine.

If you want to get data from any one computer, you can connect to it using this IP address. Humans lack the mental capacity to remember so many random strings of numbers which are essentially IP addresses. Humans can remember literature words that have some meaning. This came to be known as domains. Each computer that has an IP address also has an alias to this IP address known as a domain. Similar to IP addresses, this domain is also unique across the globe.
DNS (or Domain Name System) is used to translate this "readable name" or domain into IP addresses.
How does the Domain Name System (DNS) work?
There are 4 types of DNS servers involved in translating the domain name into an IP address.
4 Types of DNS Servers and What happens when an HTTPS request is made?

Steps involved in a DNS Lookup
Let's see what happens when you type a URL in your browser. For example, I will type - https://thegeekyminds.com in my browser.
DNS Recursor Resolver - My browser will first check in the operating system if it already knows the IP address corresponding to this URL. The IP address may be stored in the browser cache or somewhere on the computer. If the operating system knows the IP address, the search would end here. If the operating system does not know the IP address, it will ask the DNS Recursor Resolver for the IP address. The DNS Recursor Resolver may or may not have this IP address in memory. If the DNS Recursor Resolver does not have the IP address, it will direct the search to the Root Nameserver.
Root Nameserver - The root name server will reply that it knows where to find the IP Address and will direct the DNS Recursor Resolver to TLD nameservers. TLD stands for (Top Level Domain). The DNS Recursor Resolver will store all this information in its cache and go to the "COM" TLD name server.
TLD NameServer - The TLD (Top Level Domain) nameserver hosts the last part of a URL. In this case, it hosts the "com" nameserver. The TLD name server will respond that it knows where to find the "geekyminds.com" nameservers and direct this DNS Recursor Resolver to another server known as an authoritative nameserver.
You may be wondering, how the com TLD nameservers know which authoritative servers to use.
The answer is with the help of the domain's registrar.
When you purchase a domain, the registrar is told which authoritative name servers the domain should use. They notify the domain responsible for the top-level domain (registry), and tell them to update their TLD nameservers.
Authoritative Nameserver - The authoritative nameserver will definitely know the IP address. The DNS Recursor Resolver's search ends here and it takes this information and stores the information in its cache. Next time when the browser requests this URL, it will check its cache and directly fetch the IP address from there.
The DNS Recursor Resolver gives all this domain's DNS information to the operating system. The operating system then gives this information to the browser. The browser then calls the corresponding IP address and opens the webpage.
While this process seems very lengthy, this process actually takes very less time. DNS was designed to be extremely fast.
DNS Records
What are DNS Records?
DNS records are information on a domain address as to which IP address the domain is mapped to. It also contains some other information about the domain and its servers. Each DNS record also has a Time to Live (TTL) which indicates how long should the DNS server refresh the record. All the domains should have at least one DNS record for the website to be accessible for the domain on the internet.
There are several types of DNS records, Few popular ones of them are :
Frequently used DNS records
A record - The "A" in this record means the Address (IP Address). This record stores the IP address of a domain. TTL stands for (Time-to-Live) and is generally stored in seconds,

The A record only stores the ipv4 addresses. If you want to store an ipv6 address, you should use an AAAA record.
AAAA record - This record stores the IP addresses in ipv6 format

CNAME record - The 'canonical name' (CNAME) record is used as a replacement for an A record. This is used when the main domain uses an alias for a subdomain(s). The content of a CNAME always points to the main domain, not to an IP address.

MX record - A DNS 'mail exchange' (MX) record directs email to a mail server. This is the MX record which is used in accordance with the Simple Mail Transfer Protocol (SMTP). Like CNAME records, MX records also point to another domain

TXT record - LThe TXT record lets the domain administrator input text into the DNS to be presented as human-readable content. Before this became widespread, it was intended to store notes related to a domain. However, now it is also possible to put data in a machine-readable format. You can have multiple TXT records

NS record - The NS record indicates the DNS server for a particular domain and tells the internet where to find information about that domain. Basically, NS records allow external services to get in touch with the system which holds a site's data. A domain can have multiple NS records, which indicates there are both primary and secondary nameservers.

SOA record - The way that the Autonomous System Number (ASN) manages IP addresses is a complicated and nuanced process. One of the most important parts of this is the ‘start of authority or SOA record which identifies important information such as details about the administrator, who you should contact in case of an issue, when it was last updated, and how long it should wait between refreshes.

SRV record - DNS "services" (SRV) records let you specify which sorts of services you want at a specific port. For example, if you want to host VoIP, instant messaging and other things, you would set up DNS records that point to your server or IP address and indicate the ports for specific services using this. Other DNS records tend to be server or IP-specific.

PTR record - A DNS pointer record (PTR for short) provides the domain name associated with an IP address. A DNS PTR record is exactly the opposite of an 'A' record and is used in reverse-DNS lookups.
Risks of DNS

The Domain Name System (DNS) can be a target of cyber attackers. Some of the attacks which are possible:
DDoS Attack on the DNS Servers: DDoS stands for (Discrete Denial of Service Attacks). In this, the attacker floods the server with so many requests that the server becomes overloaded and fails to perform requests
DNS Spoofing: In this type of attack, the attackers corrupt the cache of the DNS Resolver, direct the incoming traffic to its servers, and perform malicious activities.
Lack of Encryption: The whole DNS system does not come with encryption. The devices connected to a local router can get their data spoofed and even manipulated. Since this has a privacy-related risk, certain solutions have come up to mitigate this.
Alternate DNS Servers
The task of DNS lookup is mostly carried out by your ISP. If you want to bypass the DNS provided by your ISP (maybe to go around censorship), you can use free publicly available DNS services. Few of them are

Once you have decided on which DNS server to use, you can configure your system to use a particular DNS provider. To get the exact configuration steps, check out this article.
And that's a wrap! Hi, I am Gourav Dhar, a software developer and I write blogs on Backend Development and System Design. Subscribe to my Newsletter and learn something new every week - https://thegeekyminds.com/subscribe
Letar du efter zgoogle-stod-nummer swedish för snabb hjälp? Hos kontaktakundtjanstsverige erbjuder vi pålitlig Google-support på svenska. Oavsett om det gäller Gmail, YouTube eller Google-konto, är vår kundtjänst här för att hjälpa dig. Kontakta oss idag och få direkt support från vårt erfarna team i Sverige.
https://social.sikatpinoy.net/terminalease
https://tekkenmods.com/user/118584/terminalease
https://www.hks-garager.com.sg/profile/johnanderson4291399896/profile
https://www.bloguemac.com/profile/johnanderson4291353876/profile
https://www.minilift.co.th/profile/johnanderson429138812/profile
https://www.sugarandspice.com.sg/profile/johnanderson4291398625/profile
https://www.rosesberryfarm.com/profile/johnanderson4291383771/profile
https://www.niftygateway.com/@terminalease/
http://okonika.com.ua/news/show/357
http://www.throwmeaway.se/artikel/historierevisionisten/
https://communaute.icotaku.com/profil/terminalease.html
https://pangian.com/remote/user/johnanderson42913
http://v5.limonteknoloji.com/index.php?journal_blog_post_id=4&route=journal3%2Fblog%2Fpost
https://app.wedonthavetime.org/profile/terminal_ease
https://decide.enguera.es/profiles/terminalease/activity
https://himanshdigi.wixsite.com/cash-management/post/what-is-cash-management-1?commentId=8114cce9-c463-48b6-aadb-786da6dda60b
https://bbs.t-firefly.com/home.php?mod=space&uid=679942&do=profile&from=space
https://webinar.leadoo.com/how-to-drive-traffic-from-social-1
https://staging.custommadecasino.com/Blog/Custom-Poker-Chips-Popular-uses
https://www.aussievision.net/post/eurovision-and-australia-decides-artists-to-feature-in-carols-in-the-domain-carols-by-candleligh?commentId=f7a5250a-9c68-4d2b-acf6-5afb47363fc8
https://swaay.com/u/johnanderson42913/about/
https://www.everydaydriver.com/single-post/the-2023-lexus-rx-350-f-sport-will-make-a-fan-out-of-you?commentId=86499b6a-36b2-4802-836e-bcc3be014783
https://www.bly.com/blog/general/writing-the-1-barrier-to-digital-marketing/#comment-1906867
https://www.pastagrammar.com/post/puccia-pugliese-italian-bread-for-epic-sandwiches?commentId=d04d3ce7-cc2e-479d-be87-53f2f8125680
https://www.journal-theme.com/7/blog/classic-watches
https://www.planet-casio.com/Fr/compte/voir_profil.php?membre=terminalease
https://www.shippingexplorer.net/en/user/terminalease/174479
http://www.fanart-central.net/user/terminalease/profile
https://jobs.digitalnest.in/employer/johnanderson42913/
https://moodle3.appi.pt/user/profile.php?id=221396
https://www.networkisa.org/profile/terminalease
https://www.theworknplay.com/Blogs/Detail/Profile/6648
https://app.waterrangers.ca/users/126337/about#about-anchor
https://www.designcontest.com/client/terminalease/
https://golden-forum.com/memberlist.php?mode=viewprofile&u=190541
https://www.clevercomponents.com/portal/community/p9833/terminal-ease.aspx
https://searchengines.guru/ru/users/2198724
https://polyamour.be/forums/users/terminalease/
https://tumblrblog.com/tips-for-getting-the-best-dallas-airport-currency-exchange/?unapproved=15920&moderation-hash=0a43757a4908a12461ddcd4a82928aba#comment-15920
https://www.biphoo.uk/profile/termnalease
https://www.bipamerica.net/profile/terminalease
https://www.crazycolores.ch/post/fast-fashion-die-dunkle-seite-der-modeindustrie?commentId=1acd5d58-ec18-4f40-b3c6-5e24cda058af
https://www.chwstrength.com/profile/johnanderson4291397916/profile
https://www.nonameglobal.com/profile/johnanderson4291371418/profile
https://www.lakedeatonumc.com/profile/johnanderson4291378489/profile
https://www.grouvee.com/user/177791-terminalease/
https://www.inc91.com/profile/terminalease
https://coinmarketcap.com/community/profile/terminalease/
https://www.creativeedgetravel.com/post/foraging-edible-wild-plants-in-italy-traditional-italian-cooking?commentId=2cfd920b-67ce-49d1-b0b7-63b2b4079a13
https://www.bloomingdiyer.com/post/coffee-table-turned-bench?commentId=ad28630d-2a76-4ef5-b092-43376408475b
https://www.achievetoday.com/post/7-steps-to-begin-integrating-a-new-level-of-work-life-balance?commentId=af2283bd-b25d-4b11-982e-a80b3ea21560
https://www.launchtechusa.com/post/product-insight-by-motorage-for-launch-x-431-torque-5-scan-tool?commentId=c1764f55-b1f5-471e-9fed-7bbf807e2dbb
https://www.cambodgemag.com/post/tourisme-prolongation-des-heures-d-ouverture-des-temples-%C3%A0-siem-reap?commentId=ed3417ca-f408-4643-ab34-e95ac3e27656
https://www.investwestlife.com/forum/main/comment/a06e8a52-9228-4962-9f29-3b22462ccf8c?postId=667a6d1e61e7b000118d0ecd
https://www.wnyathletics.com/members-area/johnanderson4291383932/profile
https://www.autolastgh.com/profile/johnanderson4291314420/profile
https://www.stories4soul.com/group/mysite-group/discussion/c50eb837-d7cb-4cc4-9d49-48b4f65b6075
https://www.imagineyounew.com/post/can-burn-scars-go-away?commentId=195a9e05-143b-4982-9259-2e1e0234a2e8
https://www.thepuenteproject.org/post/puente-students-responses-to-irma-herrera-s-play?commentId=11fa6635-45ce-4adc-a387-68e0047fd048
https://www.flintwaterjustice.com/post/former-gov-snyder-denied-qualified-immunity-in-lawsuits-for-second-time-mlive?commentId=fc2b6d8f-6980-47f0-93f6-94e9ad6ba725
https://www.thegeekyminds.com/post/dns-and-how-it-works?commentId=78095de9-7a24-402d-8555-0219b004cb70
https://www.kristinus.hu/post/roadster_kristinus_biodynamic_wines?commentId=726a297d-0553-4e52-821f-f94328cb4f96
https://www.detroitcan.org/post/from-motor-city-to-matriarchal-power-recognizing-the-pulse-of-women-s-contributions-in-detroit-s-pr?commentId=14d82e85-5d6e-4462-b742-f5f496ac9ced
https://www.rachelmcmillan.net/profile/johnanderson4291387534/profile
https://shakehand.site/author/terminalease/
According to Spirit Airlines' Cancellation Policy, travelers may cancel their journey for a cost that varies according on how far in advance they do so. Cancellations made at least seven days before to travel and within 24 hours of booking are eligible for a complete refund.
Amtrak Cancellation Policy ensures flexibility and peace of mind for travelers. Customers can cancel their tickets within 24 hours of purchase for a full refund, provided the cancellation is made before the scheduled departure. The policy varies by fare type: Flexible Fares offer full refunds with no fees, Value Fares allow partial refunds with a 25% cancellation fee, and Saver Fares are non-refundable after 24 hours but may be eligible for an eVoucher. Business Class and First Class tickets are generally refundable if canceled before departure, while private room accommodations follow a tiered refund structure based on how far in advance the cancellation is made. If a passenger does not cancel and misses the train, the ticket is forfeited. The…
Behöver du hjälp med PayPal i Sverige? Vår tjänst på kontaktakundtjanstsverige erbjuder professionell support via PayPal kundtjänst Swedish. Vi hjälper dig snabbt och effektivt med alla dina frågor, från kontoproblem till betalningslösningar. Kontakta oss för pålitlig support när du behöver det som mest – vi finns här för dig!