Setting Up DNS Servers

Ch. 3 of 515 mins4 Tasks

Configure a local DNS server, add records for company websites, and look up names from office workstations.

Track Series

Chapters in this Track (Ch. 3 of 5)

3Setting Up DNS Servers
15m

In the previous chapter, you opened the company website by typing a numbers-only address: http://192.168.1.100. That works in a simple practice lab. But in a real business with hundreds of staff, nobody wants to memorize long strings of numbers just to file an invoice or open their email.

What happens if that server breaks down and you move the website to a new machine at 192.168.1.200? Every single employee would lose access until you told them the new number. Networks solve this by using the Domain Name System (DNS).

What DNS Does for Humans and Computers

DNS works like the Contacts list on your phone. You do not remember twenty different 10-digit phone numbers for your friends; you simply tap their names. Your phone looks up the number behind the scenes and places the call.

In computer networking, DNS turns friendly names like portal.corp into machine IP addresses like 192.168.1.100. When you change server hardware, you only need to update the DNS record in one spot. Users keep typing the same friendly name without any interruption.

How a DNS Query Works Step by Step

DNS runs on Port 53 using fast UDP packets. When an office computer wants to open portal.corp, it follows four simple steps:

  1. Check Recent Memory (Cache): The computer first checks its own local cache. If you visited the site two minutes ago, it already knows the IP address and does not ask the network.
  2. Send Query to Local DNS: If the computer does not know the address, it sends a quick message to its configured DNS server (such as 192.168.1.53): "What is the IP address for portal.corp?"
  3. Server Looks Up Zone File: The DNS server checks its list of registered names. It finds portal.corp matched to 192.168.1.100.
  4. Reply Sent Back: The server sends the IP address back. The computer saves it in memory and opens the web page.
Record Type Example Name Points To What It Is Used For
A Record portal.corp 192.168.1.100 Directly links a name to an IPv4 address.
CNAME Record www.corp portal.corp An alias that points one name to another name.
PTR Record 100.1.168.192... portal.corp Reverse lookup: finds the name from an IP address.
MX Record corp mail.corp Tells email servers where to send company mail.

If the DNS server cannot find any record matching the requested name, it replies with a special message called NXDOMAIN (Non-Existent Domain). When this happens, your operating system knows the name does not exist anywhere on the network and stops searching immediately.

Why DNS Servers Must Have Fixed IP Addresses

Notice that client computers must already know where to ask for name lookups. That is why DNS servers always use fixed (static) IP addresses. If the DNS server IP address changed randomly, client computers would not know who to ask, and every website name in the building would stop working.

In enterprise offices, network administrators also provide a Secondary DNS Server address. If the primary internal DNS server ever reboots for updates, client computers automatically switch to the secondary server within a second, ensuring people can continue working without disruption.

Field Story: The Missing Dot in DNS Records

Many junior network engineers run into an issue when creating their first DNS zone. If you type a name without checking the settings, the server software might automatically append the local domain twice, creating portal.corp.corp. When users complain that portal.corp is unreachable, running nslookup portal.corp in your terminal is the fastest way to see the exact answer the DNS server returns.

Authoritative vs. Recursive Resolvers

An Authoritative DNS server is the master keeper of records for a specific domain (like portal.corp). A Recursive resolver (like Google 8.8.8.8 or Cloudflare 1.1.1.1) doesn't own records itself; it queries root, TLD (.com, .org), and authoritative nameservers on the user's behalf to track down answers across the global Internet.

The Bridge to Dynamic IP Setup

Now our office workstations know how to look up portal.corp because their network cards are configured with the DNS server address 192.168.1.53. But how did that address get into fifty different employee laptops in the first place? Did an IT administrator walk to every desk to type it in?

Manually entering DNS addresses on hundreds of workstations is slow and leads to typos. In our next chapter, we will see how a DHCP Server distributes IP addresses, default gateways, and DNS settings automatically in a fraction of a second the moment an employee plugs in their cable.

Hands-On Practice Checklist

Progress:0 / 4

Perform actions on the practice lab canvas on the right. Tasks automatically check off as you connect cables and run commands.

Task 1: Inspect DNS Server Resource Records

Click Local DNS Server on the canvas, switch to the Services tab, click DNS, and verify that the DNS Service is ON and that an A-record exists for "portal.corp" -> 192.168.1.100.

Task 2: Configure PC-1 DNS Resolver

Click Workstation PC-1, navigate to the Config tab, enter 192.168.1.53 into the "DNS Server" input field, and click "Save Configuration".

Task 3: Query Domain with nslookup Utility

Open PC-1 Terminal and run "nslookup portal.corp" to confirm that the workstation successfully resolves the name to IP 192.168.1.100.

Task 4: Browse to Intranet Portal via Domain Name

Open PC-1 Desktop tab > Web Browser, type "http://portal.corp" into the address bar, and click Go to verify end-to-end domain browsing.