hostname vs fqdn

Can someone explain what the hostname is in relation to the fqdn

For example if using Yast/Network Settings/Overview I set the ip address to static and set hostname to ‘name1.mumble.com
and then look in /etc/hosts it has added ‘99.99.99.99 name1.mumble.com name1’ at the bottom for example.
If I then go to Yast/Network Settings/HostnameDNS and set the hostname and domain name to ‘name2’ and ‘mumble.com
and then look in /etc/hosts it still says ‘99.99.99.99 name1.mumble.com’ but hostname says ‘name2’

Ta

Mal

Hi
Just check in YaST -> Network Service -> Hostnames, it may be assigning against the loopback address 127.0.0.x rather than the static IP.

I have read the help and it it seems to be doing exactly what it is suppose to do. What I don’t get
is what the machine does with the values you enter in Yast/Network Settings/HostnameDNS. The host
name part is what hostname reports but the value you put into Yast/Network Settings/Overview is
what get set in hosts. So if you ping yourself for example you would ping the name that is in /etc/host
not the name that hostname reports. OK, I can sort of see that if you had say 3 network cards each
could have it’s own name but what happens if you call the interfaces Huey, Dewey, and Louie and then
make the hostname Donald…

… then my head exploded !

This is where you run into differences of opinion.

The normal terminology is that the hostname is the part before the first “.” and the fully qualified domain name is the full length name including all of the part. The part after the first “.” is often called the domain name, and it is sometime assumed that all computers on your LAN will have the same domain name.

Some people think that a machine should have one hostname, with possibly multiple interfaces and IP addresses. Other people think that each interface should get its own hostname.

The good thing, is that much of the networking software has grown up amid this confusion, so it usually manages to cope with the different ideas that people have.

I’m glad it’s not just me :slight_smile:

M

Here is what I would hope is a clear and concise description and summary…

A Hostname really is only the leftmost part if a name contains period delimiters, eg

Abbadabba

if the machine might also be known as for examples

Abbadabba.foobar
Abbadabba.foobar.com

Typically, after the Hostname is the name of the computer group the machine belongs to. Typically it can be a Domain name, workgroup name, whatever… but if it’s only one part, then it still cannot be considered “Fully Qualified”

By definition, a “Fully Qualified Domain Name” is a computer name that includes not only the Hostname, but also the Domain and possibly Subdomain names, plus a Top Level Domain name, which if routable over the Internet must be one of the approved ICANN extensions like COM, ORG, GOV, CA, TV, etc. Note that if the group name should <not> be Internet routable, then you can choose whatever you want as long as it’s not on the ICANN approved list.

So, the question you seem to be asking is what name do you use when you create a Hosts entry?
Minimally, you only need the Hostname, and in every default Hosts file you’ll see one of this type called “localhost”
But, you’re usually not restricted to only the minimal Hostname, you can usually enter the Domain and Subdomain parts as well if you feel it’s necessary to properly identify the machine.

Note also that most name resolution systems will automatically append the configured group name to the Hostname, so you should not have to explicitly include the locally configured default group name in the Hosts file entry.

HTH,
Tony