86
34
What's the difference between Hostname and Domain name? especially in regards to NIC
Could someone please elaborate with examples as this concept is a little confusing
86
34
What's the difference between Hostname and Domain name? especially in regards to NIC
Could someone please elaborate with examples as this concept is a little confusing
84
It is usually written in the form,
hostname.domain.com
-- for example
If you are in (say) a college campus named called 'The-University
',
and its domain is called 'theuniversity.org
',
a machine on the campus network called 'mymachine
' would be addressed as,
'mymachine.theuniversity.org
'.
If you were trying to connect to this machine from your home network,
you would address it with that full name.
The domain part would reach you to the campus network
and the hostname would let you reach the exact machine in the campus.
I am avoiding the details of IP Addressing and gateways here.
For this reason, while accessing the machine from another machine within the campus
may work with just the hostname (mymachine
) without the use of the domain name.
To taken an analogy, if you are in the same city, the street name suffices.
But, to address a place in another city, you would usually add the city name after the street.
For a more detailed reading
the Wikipedia page on Domain Name Service could be a good starting place.
6
What is the difference between hostname and domain name?
A domain is something which you register and which points to your DNS servers*0. These DNS servers*1 can answer queries for hosts within that domain.
Note that these hosts do not have to be on the same network.
Example:
Gameforge*2 is a firm with some 'Freemium' games. It has servers in multiple countries. It has one single domain called gameforce.com.
s13.gameforce.com may point to a server in the UK (and an a network in the UK), while
s14..gameforce.com may point ot a server in Germany.
Network location is not tied to the domain name.
A host is a computer on a network. That host can have one more more NICs and can have IP adresses.
Especially in regards to NIC
In the case of most home computers the desktop or laptop has one active NIC and one IP, but it is possible to have multiple IPs per NIC, or use multiple NICs. For more details on that look up multi-home.
I hope that this last part answers the 'in regards to NIC'. If not then please specify your question a bit more.
*0 Or to the DNS servers of someone who manages your domain for you.
*1 At least two DNS servers in different locations are recommended.
*2I am not affiliated with them. It is just the first example I thought of.
1Yes, and one FQDN can point to many machines, and many FQDN can point to one machine.
Hostname is what the machine calls itself. Can be only one. FQDN is what others calls the machine. Can be many different names.
Use getent hosts to test it, and read the man pages. It might give some help. – Anders – 8 years ago
-4
A hostname is the name of a server, on a local network it can be a simple name like "mailserver".
For use on the Internet, domain name and hostname is for most practical purposes the same thing.
See related Wikipedia link.
Read more: http://wiki.answers.com/Q/Difference_between_domain_name_and_host_name#ixzz210PYEsh6
2
Hostname and domain name are very much NOT the same. I suspect that you answered this with a very limited an specific example in mind (e.g. http://www.domain.tld and http://domain.tld. But most domains will have many servers, each with their own hostnames. E.g. fileserver-1.domain.tld, printerser.domain.tld, my_desktop.domain.tld, mylaptop.domain.tld, etc etc. Your example ignores all this and only makes limited sense when you consider that web and mail (MX record!) are often mapped to the same place. However those are the exceptions!
– Hennes – 11 years ago1This answer is just wrong. – Teemu Leisti – 7 years ago
3It is not even a Wikipedia. – Nakilon – 12 years ago
2@CiroSantilli六四事件法轮功包卓轩 They are both hostnames. The name
www
by itself is unqualified, and you are quite correct that it will only resolve properly "internally". In fact, it will resolve differently depending on a network's DNS configuration. The namewww.google.com
is a fully qualified domain name (FQDN; which unfortunately confuses the distinction between "host name" and "domain name") and should resolve the same from any system connected to the Internet. – kbolino – 9 years ago@kbolino So when would my computer connect to
www.google.com
when I writewww
? Where would my computer needed to be physically located? – Utku – 9 years ago1@Utku It's not about physical location per se. You could have
google.com
on your DNS search path (which can be set automatically via DHCP), you could have a DNS server that aliaseswww
towww.google.com
with aCNAME
record, or you could add lines to/etc/hosts
. You can do any of these things yourself on your own computers/network, but this is normally left to your network and system administrators to configure. – kbolino – 9 years ago@kbolino Actually I couldn't write properly what I am trying to ask. In the answer, it ia stated that if you are on the campus, you may access
mymachine
just by typingmymachine
. But if you are at home, you must type the fullmymachine.theuniversity.org
. I am wondering what exactly causes this behavior? What makes it possible to access tomymachine
just by typingmymachine
when you are on campus, but not when you are not on campus? – Utku – 9 years ago@Utku One of the 3 methods I described. The key difference between being on campus and being at home is that you are using 2 different networks. They have different configurations and different infrastructure. On campus, the university's network administrators have set things up to work like that; at home, your ISP's network administrators have not. – kbolino – 9 years ago
FQDN = HostName+Domain, in terms of command output : "hostname -f" = "hostname"."hostname -d" – Bharat – 9 years ago
@Bharat, actually. No. FQDN is a domain name. Last part could be a hostname, or not. It is the TYPE of the FQDN that desides that. Type A gives an IPv4, AAAA an IPv6 address, which addresses a machine. They are are usually set so the host part are same as the hosts own name, but it doesn't need to. Hostname are set in /etc/hostname and probably /etc/hosts. FQDN are set in the network DNS server (or in /etc/hosts for the local machine). Example: hostname bilbo could have FQDN bilbo.exampel.com and www.example.com and example.com. All being some of A or AAAA or CNAME. Test with getent hosts – Anders – 8 years ago
would i have to mention the hostname somewhere when configuring the dns? and if I have a static IP pointing to the domain name would I have to mention the hostname anywhere or that is independent of the domain name configuration – rzlines – 15 years ago
what if i add an A record then isn't that an IP pointing to a domain name? or vice versa? – rzlines – 15 years ago
3I disagree. A domain is not limited to a physical location, and not even to a specific network! – Arjan – 15 years ago
2@Arjan, I accept your disagreement. I have 'over' simplified in the answer. – nik – 15 years ago
@nik: in
– Ciro Santilli 新疆改造中心法轮功六四事件 – 11 years agowww.google.com
is the hostname justwww
orwww.google.com
? Gillian sayswww.google.com
. If so, that means that the hostname depends on where you are is that it? (local vs remote)