Interview Prep/Linux/Networking, SSH and remote access

You must make sure a server's hostname and FQDN are set correctly before joining it to a domain. How?

BeginnerScenarioNetworking, SSH and remote access
Answer

Situation read → Static hostname plus resolvable FQDN.

What I'd do →

sudo hostnamectl set-hostname app01.corp.example.com
hostnamectl
hostname -f
getent hosts app01.corp.example.com

Add a /etc/hosts entry if DNS isn't set up yet. On cloud images, set preserve_hostname: true in cloud-init so it isn't reset.

Why → Kerberos and many domain tools fail if the FQDN doesn't resolve.

Interview tip → Cloud-init resetting the hostname on reboot is a common surprise.

All Linux questions Roadmap: Linux

More on Networking, SSH and remote access