Back to lessons

Web Server Rescue

Check the WWW CNAME Target

You need to see whether www is an alias and where it ultimately resolves.

Command

dig +short www.edge.test CNAME

What changed

Nothing changes. The command queries DNS records only.

Danger

safe

When to use it

Use when apex and www behave differently after a CDN or hosting change.

When not to use it

Do not assume a CNAME target is healthy; resolve and test the target separately.

Undo or recovery

No undo needed because this command is read-only.

Expected output

The CNAME target for the www hostname.

demo script

Disposable terminal steps

  1. dig +short www.edge.test CNAME
  2. dig +short www.edge.test A

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ dig +short www.edge.test CNAME
edge.test.
::exit-code::0
$ dig +short www.edge.test A
203.0.113.10
::exit-code::0

YouTube Short

Check the www alias.

If apex works and www fails, inspect the CNAME path before changing TLS or web config.

LinkedIn hook

The apex was right. The www name pointed through a different path.

Question: Do you test apex and www as separate DNS paths?

experiments

A/B tests to run

Metric: comment_rate

A: www used a different path.

B: Check the alias target.