DNS and certificates for hosting
Quick answer
DNS maps names to service addresses. TLS establishes encrypted communication and verifies server identity when the client validates the certificate and hostname.
Name resolution directs clients toward an address; TLS certificate verification establishes whether the presented identity matches the requested service under a trusted chain. A correct address can still present an invalid certificate. Verify these stages independently without disabling verification.
Prepare the practice environment
Run python3 lab-fixtures/servers/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Only local loopback services and private files are used. Optional examples require an authorized snapshot VM. Never expose a lab listener publicly or modify system services. Review the lab guide.
How it works
A records map names to IPv4 addresses, AAAA to IPv6, and CNAME aliases a name to another name. TTL influences caching; changing a DNS record does not update every cache immediately. A certificate needs a valid trust chain, appropriate validity dates and a matching identity, normally a DNS subject alternative name. ACME can automate issuance and renewal for authorized domains. Monitor expiration, renewal and the certificate actually served. The helper creates an ephemeral self-signed lab certificate with SAN site.example, uses it as a deliberately trusted local certificate, verifies a matching hostname, then checks that a mismatched name fails. It never requests a public certificate or changes a trust store. The lab tests certificate verification offline, not a full TLS connection.
Try the examples
192.0.2.10 is a documentation address. This is a model, not an actual DNS query.
Expected stdout:
site.example 192.0.2.10The helper uses openssl verify -CAfile with -verify_hostname and checks successful verification against explicit lab trust.
Expected stdout:
hostname verifiedThe same trusted lab certificate fails identity verification for other.example. Do not fix this by disabling verification.
Expected stdout:
hostname mismatch rejectedCommon mistakes
Never disable certificate verification to make a connection work. Do not publish private keys or embed ACME credentials in scripts. DNS correctness alone does not prove TLS correctness.
Practice
Explain why a correct DNS address may still yield a certificate error. Draw a renewal-monitoring checklist covering expiration, matching identity and the deployed certificate.
Related references
Study: dig, openssl, curl. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
DNS and certificates for hosting — Knowledge Check
Apply hosting and deployment concepts to synthetic fixtures and VM-only scenarios.
What does an AAAA record contain?
What is checked by hostname verification?
Can a trusted certificate fail hostname validation?
What should happen after renewal?