5-3 Configure Networking and Hostname Resolution Statically or Dynamically: Hostname Configuration Flashcards
Start and Stop Network Manager
systemctl start NetworkManager
systemctl enable NetworkManager
systemctl restart network
If you get lost, use the man page for nmcli-examples to help when configuring nmcli
Display the systems fully qualified hostname
hostname
/etc/hostname — Manages the “static” hostname for the system. Rather than modifying the file,
you can use the hostnamectl command
hostname command can show and change hostname but is not persistent, need to update /etc/hostname file for persistence
hostnamectl is persistent, it updates /etc/hostname file
hostnamectl set-hostname system.domain.com
hostnamectl status
in /etc/resolv.conf file
search us-west-2.compute.internal
setup dns connections to first search for hostnames ending with given
in /etc/resolv.conf file
search us-west-2.compute.internal
setup dns connections to first search for hostnames ending with given us-west-2.compute.internal
so if only host1 is given for host1.us-west-2.compute.internal, it’ll still work
/etc/hosts
ip address) (domain name
poisin dns so hostname yahoo.com goes to 1.1.1.1
in /etc/hosts file
(ip address) (domain name)
1.1.1.1 yahoo.com
poison dns so hostname yahoo.com goes to 1.1.1.1
in /etc/hosts file
1.1.1.1 yahoo.com
poison dns so hostname yahoo.com goes to 1.1.1.1
/etc/resolv.conf is managed by Network Manager
Use network manager to edit /etc/resolv.conf
Or modify connection configuration directly in directory /etc/sysconfig/network-scripts
default system looks locally in
/etc/hosts first, before going to /etc/resolv.conf to look externally
how to change that behavior
in /etc/nsswitch.conf file
hosts: files dns hostname
means it’ll look locally at /etc/hosts, then nameserver in /etc/resolv.conf to look externall, then hostname