Hostname vs. IP - address
30,481
A host name is a combination of the name of your machine and a domain name (e.g. machinename.domain.com). The purpose of a host name is readability - it's much easier to remember than an IP address. All hostnames resolve to IP addresses, so in many instances they are talked about like they are interchangeable.
Author by
Admin
Updated on June 25, 2020Comments
-
Admin almost 4 years
I am currently implementing openssl into my application. My problem arose when I had to set the hostname, IP - address, and port of the BIO. I have always known ip and hostname to be the same thing. Could someone please explain the difference.
-
trnelson over 9 yearsJust wanted to add that a host name resolves to an IP address by DNS. Not fully relevant to the question but kind of brings this answer full circle.
-
Admin over 9 yearsYou saying that a hostname resolves to an IP makes me think that they are the same again
-
Jim Davis over 9 yearsSay your name is Steve and your phone number is 555-1212. DNS is the phonebook. I can "call steve" or I can "call 555-1212" and get the same result. One's a name, one's an address.
-
ChristophK over 4 yearsDownvote for "A host name can have multiple IP addresses, but not the other way around". It's possible, see serverfault.com/questions/65781/multiple-reverse-dns-entries.
-
Paul Whipp almost 4 yearsThey are not the same: The hostname is a mapping to the IP address. Over time the same hostname could map to a different IP address. This might be done where a web service is rebuilt on a different machine for example. In Jim's example, Steve might change his phone number but he would still be Steve.