redhat set hostname and fqdn

vi /etc/hosts
192.168.56.101 nix.example.com nix
vi /etc/hostname
nix
hostnamectl --static set-hostname nix
systemctl restart systemd-hostnamed
hostname -f