Why Hostname Matters
A correctly configured hostname is essential for SSL certificate validation, email delivery (SPF/DKIM), service discovery, and cluster communication. Misconfigurations can cause subtle and hard-to-diagnose issues.
Checking Hostname
hostname
hostname -f # FQDN
hostname -I # IP addresses
hostnamectl
Verifying /etc/hosts
cat /etc/hosts
# Should contain:
# 127.0.0.1 localhost
# server-ip hostname.domain.com hostname
DNS Resolution Verification
dig +short $(hostname -f)
nslookup $(hostname -f)
getent hosts $(hostname -f)
Reverse DNS Check
dig -x $(hostname -I | awk "{print \$1}")
host $(hostname -I | awk "{print \$1}")
nslookup $(hostname -I | awk "{print \$1}")
Automated Verification with dargslan-hostname-check
pip install dargslan-hostname-check
dargslan-hostname-check
dargslan-hostname-check --dns
dargslan-hostname-check --reverse