17/34
Sign inSign up free

1019. Test the New Server Before Changing DNS

medium 20 XP ~9 minHands-on lab

shop.example.test is moving to a new cluster. Before DNS is switched, the team wants to check a candidate server by IP, exactly as clients will see it after the cutover: same hostname, same TLS certificate check, same Host header.

Candidate servers for experiments: run /srv/lab/bin/start-servers, then try 127.0.0.2 (the new cluster) and 127.0.0.3 (a wrong machine). Both listen on port 8443. The internal CA is /home/student/pki/ca.pem.

Task

Create the executable script /home/student/bin/cutover-check.sh IP that requests https://shop.example.test:8443/health from the server at IP, verifying the certificate against ca.pem and the name shop.example.test. It prints the HTTP status code and exits 0 only for 200.

Don't use -k/--insecure, and don't change /etc/hosts.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.