🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Web & Software Development › Deployment: Servers, CI/CD, and Cloud Publishing › Lesson 5
TEC-WEB46-07 · Lesson 5 · 14 clock hours · lab

DNS Configuration and TLS with Let's Encrypt

Objective. Students point a domain name to their VPS using DNS A records and obtain and install a free TLS certificate with Certbot so the site is accessible over HTTPS.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

What DNS Does and Why It Matters

Every website you visit has a numeric IP address—for example, `203.0.113.45`. Humans remember names, not numbers, so the Domain Name System (DNS) acts as a phone book that translates a hostname like `example.com` into the IP address your browser needs. When you own a domain name, you control that translation by editing records stored at a DNS registrar or a separate DNS hosting provider.

For your VPS-hosted site to be reachable by name, you must create an A record that maps your hostname to your server's public IPv4 address. Until that record exists and propagates across the internet, your domain points nowhere useful.

Types of DNS Records You Will Use

Creating an A Record

Log in to your registrar's DNS management panel. Locate the option to add a DNS record, then fill in:

| Field | Value |

|-------|-------|

| Type | A |

| Host / Name | `@` (for the root domain) or `www` |

| Value / Points to | Your VPS public IP address |

| TTL | 300 (five minutes, for testing) |

Save the record. DNS changes do not take effect instantly; propagation across the public internet can take a few minutes up to 48 hours, though 5–15 minutes is typical with a low TTL.

Verifying Propagation

Use the `dig` command-line tool to query DNS from your terminal:

```

dig A www.yourdomain.com +short

```

When the output shows your VPS IP address, propagation has reached the DNS resolver your machine is using. You can also use `nslookup`:

```

nslookup www.yourdomain.com

```

Do not proceed to the TLS step until DNS resolves correctly. Certbot contacts Let's Encrypt servers, which then reach back to your domain over HTTP to verify ownership. If DNS is not propagated, the verification will fail.

Why TLS and HTTPS Are Required

HTTP transmits data in plain text. Anyone on the same network can read or modify it. TLS (Transport Layer Security) encrypts the connection between browser and server. HTTPS is HTTP carried over a TLS connection. Modern browsers mark non-HTTPS sites as "Not Secure" and many features (geolocation, service workers, certain APIs) require a secure context. Employers expect all production sites to use HTTPS.

A TLS certificate proves that the entity presenting it legitimately controls the domain. Certificates are issued by a Certificate Authority (CA) that browsers trust. Let's Encrypt is a free, automated, open CA operated by the non-profit Internet Security Research Group. It issues 90-day certificates at no cost.

Installing Certbot and Obtaining a Certificate

Certbot is the official Let's Encrypt client tool, maintained by the Electronic Frontier Foundation. On Ubuntu/Debian with Nginx already installed:

```bash

sudo apt update

sudo apt install certbot python3-certbot-nginx -y

```

Then run the Nginx plugin to obtain and install the certificate automatically:

```bash

sudo certbot --nginx -d www.yourdomain.com

```

Certbot will:

1. Verify you control the domain using the HTTP-01 challenge (places a temporary file in your web root and asks Let's Encrypt to fetch it).

2. Download the certificate and private key.

3. Rewrite your Nginx server block to listen on port 443 with TLS and add a redirect from HTTP (port 80) to HTTPS.

Follow the prompts: enter your email address (used for renewal notices) and agree to the terms of service.

Confirming the Certificate in a Browser

Navigate to `https://www.yourdomain.com`. Click the padlock icon in the address bar and inspect the certificate. You should see:

The browser should show no mixed-content warnings. Mixed content means an HTTPS page is loading resources (images, scripts, stylesheets) over plain HTTP; this breaks security and is flagged by browsers.

Automatic Renewal

Let's Encrypt certificates expire after 90 days. Certbot installs a systemd timer or cron job that attempts renewal automatically when fewer than 30 days remain. Verify the timer is active:

```bash

systemctl status certbot.timer

```

You can do a dry run to confirm renewal would succeed:

```bash

sudo certbot renew --dry-run

```

Safety and Professional Practices

Key terms10

DNS (Domain Name System)A global distributed database that translates human-readable hostnames (such as example.com) into IP addresses computers use to route traffic.
A RecordA DNS record type that maps a hostname to an IPv4 address, telling resolvers where to send traffic for that name.
TLS (Transport Layer Security)A cryptographic protocol that encrypts data in transit between a client and server, providing the security layer beneath HTTPS.
Certificate Authority (CA)A trusted organization that issues digital certificates verifying the identity of a domain owner; browsers ship with a built-in list of trusted CAs.
Let's EncryptA free, automated, non-profit certificate authority that issues 90-day TLS certificates through the ACME protocol, removing cost as a barrier to HTTPS adoption.
CertbotAn open-source client tool maintained by the EFF that automates obtaining, installing, and renewing Let's Encrypt certificates on a web server.
HTTP-01 ChallengeA domain-ownership verification method used by Let's Encrypt in which the CA fetches a specific token file from the domain over port 80 to confirm control.
Mixed ContentA security problem that occurs when an HTTPS page loads sub-resources (scripts, images, stylesheets) over plain HTTP, weakening the page's security and triggering browser warnings.
TTL (Time to Live)A DNS record field specifying how many seconds resolvers should cache a record before fetching a fresh copy; lower values speed up propagation of changes.
PropagationThe gradual spread of a DNS change across resolvers worldwide after a record is updated at the authoritative name server.
In class: Log in to a DNS registrar (instructor-provided test domain or student-owned domain) and create an A record pointing the hostname to the VPS public IP address; verify propagation using dig or nslookup. · Install Certbot and the Nginx plugin, run certbot --nginx to obtain a certificate for the domain, and confirm Certbot rewrites the Nginx config to redirect HTTP to HTTPS. · View the certificate details in a browser, noting the issuer (Let's Encrypt), validity period, and renewal date, and record findings in the lab log.
Materials: Student VPS with Nginx, registered domain name or subdomain, Certbot documentation (certbot.eff.org), dig utility, browser, lab log
Check: Instructor navigates to the student's HTTPS URL and confirms a valid, browser-trusted certificate is present with no mixed-content warnings; lab log entry complete. 80% rubric score required.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

CompTIA ITF+ – Networking Concepts
1. Which DNS record type maps a hostname directly to an IPv4 address?
CompTIA Linux+ – System Configuration and Operation
2. You add an A record for your domain but the dig command still returns the old IP. What is the most likely reason?
CompTIA Linux+ – System Configuration and Operation
3. What command verifies that a domain's A record resolves to your expected IP address from a Linux terminal?
CompTIA Linux+ – Security
4. Why must port 80 remain open in the VPS firewall even after HTTPS is configured?
CompTIA ITF+ – Security Concepts
5. How long is a standard Let's Encrypt certificate valid before it must be renewed?
CompTIA ITF+ – Security Concepts
6. A student visits their site at https://example.com but the browser shows a mixed-content warning. What is the most likely cause?
CompTIA Linux+ – System Configuration and Operation
7. After running certbot --nginx, which of the following best describes what Certbot does to the Nginx configuration?
CompTIA Linux+ – Security
8. Which best practice protects the TLS private key stored on your VPS?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.