hostnames and interfaces
jerrymc at clunix.cl.msu.edu
Fri Nov 21 08:57:06 PST 2003
> At 10:35 AM 11/21/2003, Jerry McAllister wrote:
> >You can also configure your NIC to answer to multiple IP addresses
> >and then configure your Apache to treat each as a virtual host with
> >a separate hostname/URL. Yes, you have to have whoever is serving
> >DNS for you (either yourself, your ISP or some DNS service) set up
> >to translate IP <-> hostname
> Jerry, thanks for trying but I don't know what this means (I've heard this
> remark so many times myself from others...). Yikes, I'm just a blathering
> idiot. :(
Well, I am not the best one to explain in detail.
For this specific item, your best bet might be to study the
Apache documentation on doing virtual hosts and maybe do some
searching on the net (Google, etc) on the subject.
Generally, it seems like there are actuall several questions being
asked in this series of posts and I am having trouble figuring out
what the core issue is. Hostnames and IPs are used on the net to
address machines. Some of these can be 'virtual' machines that are
hosted by machines that are set up to respond to a lot of either/or
hostnames and IPs. Each actual machine that lives on the net will
have a specific hostname and IP address that is its own and all the
others that it answers to are considered either virtual addresses or
aliases. A DNS server sorts out the relationships and reports
the matchings between IPs and hostnames. You can run your own DNS
server, especially if you have a lot of machines and your own domain,
or you can arrange with another entity, such as your ISP or another
DNS service to do that for you.
If you are not connected to the net, it doesn't matter what you call
your machine or how many aliases you create or what IPs you use, though
you might want to stick to the designated private IP ranges if you
create your own intranet even if it is not connected to the internet.
There is no limit other than practical ones that I know of to how
many aliases/virtual hosts you create if you are running an intranet
that is not connected to the internet.
If you connect to the internet, the domain you are using must be
registered with a registering service. The service you use depends on
the top level element of the name (.com .net, .org, .edu, .cn, .fr, etc)
Your ISP will normally be the best one to help you with that (except that
some ISPs are decidedly unhelpful; then you have to go looking)
A fully Qualified Host Name consists of two main parts.
A machine name such as 'mypc' and a domain name such as concern.com.
They are assembled in to a FQHN (Fully Qualified Host Name)
- as mypc.concern.com in this example.
During installation, when it asks for hostname, it wants a Fully
Qualified Hostname if you are going to be connected to the internet.
You might just as well fake one if you are not going to be on
the internet just to be consistent, but you can put just a single
string if you want. IP addresses must be in the form xxx.xxx.xxx.xxx
unless you are playing with IPV6 and if you are, you should know all
this already so stop reading.
There is often much misspeak about these. The full qualified hostname
is often called a domain name, for example when only the last part is
really the domain name. Plus, the term hostname is used to refer to
both/either the single machine part of the name such as 'mypc' above
and the fully qualified hostname 'mypc.concern.com' as above. This
leads to much confusion and I wish we had better names. But, that is
the way it is.
The domain name 'concern.com' must be registered with the service
handling .com. Then whoever owns the 'concern.com' domain allows or
directs hostnames to use it. If you registered the domain name, then
When the 'concern.com' domain name is registered, you have to tell the
service what DNS server will be providing DNS service for that domain.
It may be you if you registered the domain name and have a DNS server
or it might be some other system, such as one run by your ISP or another
company that runs DNS servers for hire. Whenever you create a host
that resides in the domain, such as 'mypc' in 'mypc.concern.com' an entry
must be made in whatever DNS server that is handling the 'concern.com'
domain. That is required before it will do correct translation.
The physical machine that is mypc on the concern.com domain may answer
to lots of host names and even lots of IPs. There are two parts to
making this happen.
The 'mypc' machine must be set up to respond to all those host names
besides its own name. If it involves additional IP address (an alias)
it is done in a rc.conf ifconfig alias statement (or we actually put those
in a rc.conf.local file and add an include just to keep things a little
more clean and clear), and/or in the software that is expected to respond
to it, such as Apache. If it is only a different hostname, it can be
done only by configuring the software that responds to it. For Apache,
for example, you configure it in either httpd.conf or better in
virtualhosts.conf (and make sure httpd.conf has an entry to include
virtualhosts.conf) to listen to particular IPs and/or hostnames and tell
it which web pages to go looking for for each different one. Something
similar can be done for Email servers and other pieces of software.
The other part to making it respond to multiple hostnames and/or IPs is
making sure the DNS server has the proper entries to translate addresses.
I am not sure if there is some logic for the secondary addresses/names
being called aliases or virtual hosts or not. Apache calls them
virtual hosts and Email servers seem to call them aliases as does
the boot up configuration (rc.conf, etc).
As someone has mentioned, if you are not on the internet, much of this
does not matter. You can enter almost anything when it asks for
hostname and claim any IP you want. You can set up your own DNS server
and make it all work any which way you choose.
This is quite general. From this overall view, the rest is up to you to
study documentation to understand. There are many subtleties admins add.
> Marty Landman Face 2 Interface Inc 845-679-9387
> Sign On Required: Web membership software for your site
> Make a Website: http://face2interface.com/Home/Demo.shtml
More information about the freebsd-questions