#!/bin/bash

domain_name="$(hostname --all-fqdns | awk '{print $1}')"
if [ -z "$domain_name" ]; then
  domain_name="$(hostname)"
fi
echo $domain_name | sed -e 's/^[[:space:]]*//'
