Hostname
Hostnames—such as www.facebook.com
, www.google.com
, gaia.cs.umass.edu
—are mnemonic and are therefore appreciated by humans.
However, hostnames provide no information about the location within the Internet of the host. This is why we identify hosts with IP Addresses. To do the conversion, we use the DNS.
Hostname in Ubuntu for SSH
When you are logged into a linux machine, you might see something like steven@ubuntu
. In this case, it follows the format
<username>@<hostname>
2023-10-30: Ahhh, I finally understand the point of hostnames, they’re basically like aliases, so instead of having to add the ip manually, i.e. calling ssh user@11.481.32.169
, you can have something much simpler like ssh user@robot
.
Your network does have to know this, you need to use hostnamectl
Setting up your hostname
I did this for the first time with the Code19 computer. Also needed for the BracketBot.
You do something like this
sudo apt update
sudo apt install avahi-daemon -y
Then
sudo systemctl start avahi-daemon
sudo systemctl enable avahi-daemon
sudo systemctl status avahi-daemon
And then, you might need to change the firewall settings
sudo ufw allow 5353/udp
sudo ufw reload