Back to commands

Web Server Rescue

Read-only

Your Site Is Not Down. DNS Might Be Lying.

A domain appears unreachable, but you need to separate a real server outage from stale or wrong DNS.

Command

curl --resolve example.com:443:203.0.113.10 https://example.com/

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not treat a successful forced request as proof that public DNS is correct. Do not use it to test someone else's service without permission.

Expected output

HTTP response headers or page content from the target server. The lab example uses a local test service on port 8443; a real web server normally uses 443.

System impact

Read-only. The request bypasses normal DNS for one call and tests the HTTPS server directly. The temporary shell lab uses a local test service so it stays offline and deterministic.

When to use it

Use this when DNS, browser cache, router DNS, or CDN routing may be hiding the real server state. In production, replace the example domain and IP with the host you control.

When not to use it

Do not treat a successful forced request as proof that public DNS is correct. Do not use it to test someone else's service without permission.

Recovery / rollback

No system state is changed. Remove the forced IP and test normal DNS again.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ dig +short example.com

198.51.100.44

$ curl -k -sS --max-time 2 -D - -o /dev/null https://localhost:8443/

HTTP/1.0 200 ok
Content-type: text/html

$ curl -k -sS --max-time 2 --resolve example.com:8443:localhost -D - -o /dev/null https://example.com:8443/

HTTP/1.0 200 ok
Content-type: text/html
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. dig +short example.com
  2. curl -k -sS --max-time 2 -D - -o /dev/null https://127.0.0.1:8443/
  3. curl -k -sS --max-time 2 --resolve lab.local:8443:127.0.0.1 -D - -o /dev/null https://lab.local:8443/

next steps

Related commands

Web Server Rescue Read-only

Smoke Check an HTTP Status

A deploy is not done until the endpoint answers.

curl -fsS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/health
Hosting Operations Read-only

Inspect Response Headers

The page loaded, but the headers told the operational story.

curl -sI https://example.com
Hosting Operations Read-only

Check HTTP to HTTPS Redirect

HTTPS worked. The plain HTTP redirect still mattered.

curl -I http://example.com
Hosting Operations Read-only

Check a Domain A Record

The site was fine. The domain was pointed somewhere else.

dig +short example.com A
Web Server Rescue Sensitive output

Check the Certificate Served for SNI

The IP was right. The SNI name selected the wrong certificate.

openssl s_client -connect 203.0.113.10:443 -servername wrong.edge.test </dev/null 2>/dev/null | openssl x509 -noout -subject -ext subjectAltName
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:109-networking
  • lfcs:networking
  • lfcs:services-logs
  • linuxplus:provisional
  • linuxplus:troubleshooting
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.