Re: hostnames and interfaces

2003-11-21 Thread Rob
My non-technical understanding:

* A BSD system has a fully qualified domain name that is set and
retrieved by the hostname(1) command. This is normally defined in
/etc/rc.conf and considered the 'true name' of the system. If this name
does not resolve to an IP address, many network services will complain
(such as sendmail). If this IP address is not configured on an interface
on the system, many things will get confused (such as routing).

* You can also configure other interfaces, either on extra network cards
or using the alias option of ifconfig(8). These interfaces should have
different IP addresses, and names are optional (but convenient).

* Any IP address can have extra names, either in /etc/hosts or on a
nameserver. The 'canonical' name should probably come first.

Your average BSD system will have 1 hostname that resolves to 1 address
configured on its single network interface. The /etc/hosts file will map
this address to the FQ hostname, and probably also to the short version
for convenience.

It will also have the name localhost, resolving to 127.0.0.1 and
configured on lo0, again using /etc/hosts for resolution.

Anything beyond that is up to you...

- Original Message -
From: paul van den bergen [EMAIL PROTECTED]
Subject: hostnames and interfaces


 hey all,
 I first encountered networking in CISCO land... where IP addresses and
host
 names seem to be associated...

 what is the freeBSD way?  AFAICS, a machine has a defined name
regardless of
 howmany interfaces it has.  if one splits the world up into hosts (one
 interface) and routers (multiple interfaces) can one define multiple
 hostnames?

 to expand on this, there is a potential many to many relationship here
between
 host names and IP addresses (strickly speaking that is what dns etc
sees?)

 how dose BSD define this? how does one define this using BSD?


 --
 Dr Paul van den Bergen
 Centre for Advanced Internet Architectures
 caia.swin.edu.au
 [EMAIL PROTECTED]
 IM:bulwynkl2002
 And some run up hill and down dale, knapping the chucky stones
 to pieces wi' hammers, like so many road makers run daft.
 They say it is to see how the world was made.
 Sir Walter Scott, St. Ronan's Well 1824

 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
[EMAIL PROTECTED]


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: hostnames and interfaces

2003-11-21 Thread Matthew Seaman
On Fri, Nov 21, 2003 at 12:17:30PM +1100, paul van den bergen wrote:

 I first encountered networking in CISCO land... where IP addresses and host 
 names seem to be associated...
 
 what is the freeBSD way?  AFAICS, a machine has a defined name regardless of 
 howmany interfaces it has.  if one splits the world up into hosts (one 
 interface) and routers (multiple interfaces) can one define multiple 
 hostnames?
 
 to expand on this, there is a potential many to many relationship here between 
 host names and IP addresses (strickly speaking that is what dns etc sees?)
 
 how dose BSD define this? how does one define this using BSD?

Good question.  Yes, this can be a problem with a multi-homed host:
not really in any functional sense, but for organizational purposes.

Any machine will have a hostname -- that is the name which gets
printed in shell prompts and that the system uses by default to
identify itself for such services as SMTP servers, LDAP, NIS, HTTP
etc.  The hostname is set by (surprise, surprise) the hostname(1)
command using the data from /etc/rc.conf.  This is generally recorded
in /etc/hostnames, possibly with the names of various other local
machines around the place because that's the one lookup system that's
always available even when the network isn't up. But /etc/hostnames
doesn't have to be used at all: I generally prefer to have the DNS be
*the* unique data source for this sort of thing, so my /etc/hostnames
files are pretty skeletal.

Relying on the DNS leads to the use of hierarchical domain names and
yet another religious argument: if the FQDN is 'foo.example.com' do
you set the hostname to just 'foo' or do you use the fully qualified
domain name as the hostname?  The problem with using just 'foo' is
that there is no general mechanism for telling the system what the
rest -- the 'network part' of the name -- should be.[1] As good
sys-admins we should be allergic even to the possibility of things
going horribly wrong, and using the FQDN as the hostname closes off
several potential trouble spots.

However using the hostname as the default for all of the various
services is generally only a convention. Those services can usually be
configured to use whatever names you may imagine: role based names
(www.example.com) are fairly common -- which is useful if you need to
swap out machines for maintenance as you can just switch the role-name
to an alternative server fairly simply.  This also allows you to run
'virtual' servers: multiple instances of the same service on one
machine.

Since these services are generally networked based, they have to have
an IP number associated with them: most of the time a CNAME record in
the DNS will do, but some things like SMTP MXes or HTTPS virtual hosts
need real A records.

Now, most of this discussion has implicitly assumed that we're using a
machine with a single network interface and just one IP number.  For a
big server, that's probably not going to be the case -- there may well
be several IP numbers configured on a single interface (have to do
this for eg. hosting multiple HTTPS virtual hosts on one machine) or
several network interfaces, either to provide redundancy against
failure of network kit or to allow the machine to have direct
connections to several physical networks.

In this case, it's perfectly reasonable to have all of:

* the machine hostname as an A record configured in the DNS to
  return a list of all of the interface IP numbers, and
  corresponding PTR records.

* individual domain names as A records that resolve to each of the
  IP numbers on the interfaces, or to the principal address on
  each interface, or to per-network IP numbers, and corresponding
  PTR records: together with the above, this means that looking up
  the IP number can return several hostnames.

* role based names that can include all combinations of all of the
  above, either as A+PTR combinations or as CNAMES.

Having several host names resolving to the same IP number is not a
problem.  Of course, being good DNS admins we will set up PTR records
to do the inverse lookups.  Personally I feel that having PTR records
that return several domain names is perfectly valid, but there's various
old documentation that insists the sky will fall if you do things like
that.[2]

In summary the whole relationship between host and domain names and IP
numbers is defined by whatever works for you...

Cheers,

Matthew

[1] There was for a long time a confusion between the NIS domain name
and DNS based names, especially on Solaris machines. However NIS and
DNS are separate systems and don't have to use the same domain
structure at all.  Nowadays LDAP is taking over from NIS, and again
this has it's own hierarchical structure although one increasingly
popular layout is to mimic the DNS hierarchy.  The default domain or
search path in /etc/resolv.conf is sort of going in the right
direction, but there's no rule that says 

Re: hostnames and interfaces

2003-11-21 Thread Jerry McAllister
 
 On Thu, 20 Nov 2003 20:42:33 -0500
 Marty Landman [EMAIL PROTECTED] granted us these pearls of wisdom:
 
  At 08:17 PM 11/20/2003, paul van den bergen wrote:
  
  to expand on this, there is a potential many to many relationship here 
  between
  host names and IP addresses (strickly speaking that is what dns etc sees?)
  
  how dose BSD define this? how does one define this using BSD?
  
  Hey, sounds like you understand things so well you see the void in the 
  forest. As a newbie I'm still just trying to keep my head from twisting off 
  at long enough intervals to define some of the questions. Like, given I 
  have 5 boxes - 1 fbsd 4 windoz though maybe that proportion will change in 
  a time :) - and each has their own ip adr and I have two apaches installed 
  does that mean I can setup a max of 5 different domain level websites on my 
  intranet? Or 10? Or infinite (well, this is reality I hope so...)
  
  The daemons are afoot, my ponderings do not affect them.
 
 Hi,
 Let me see if I can shed some light on this issue for you. To the best
 of my knowledge a FBSD system can have only one hostname however it can
 have as many aliases as you wish. The setup of aliases is acheived via
 DNS rather than assigning hostnames per interface. Where you have
 multiple machines you would assign multiple hostnames whether they be
 from different domains or not.
 
 $ host mail.meibin.net
 mail.meibin.net is a nickname for kyoto.meibin.net
 kyoto.meibin.net has address 220.111.132.28
 
 per the above the actual host name for the system is kyoto, it's FQDN is
 kyoto.meibin.net and it has the alias of mail.meibin.net rather than the
 host name of mail.meibin.net .
 
 Apache and loads of other software support virtual hosting and defining
 a name in an apache configuration has little to do with the actual
 underlying system hostname. That being said virtual hosts don't work
 well if DNS was not set correctly for them. 

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 and if it involves a new Domain name,
you have to register it with the appropriate registering agency.
Most of our sites use a separate IP for each virtual host for
various reasons.   But, you can also have multiple aliases per
IP address as the poster indicates.

jerry

 
 HTH
 
 LukeK
 
 ___
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: hostnames and interfaces

2003-11-21 Thread Marty Landman
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. :(

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
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: hostnames and interfaces

2003-11-21 Thread Jerry McAllister
 
 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 
you decide.

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 

Re: hostnames and interfaces

2003-11-21 Thread Michael K. Smith
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Nov 20, 2003, at 5:42 PM, Marty Landman wrote:

 At 08:17 PM 11/20/2003, paul van den bergen wrote:

 to expand on this, there is a potential many to many relationship 
 here between
 host names and IP addresses (strickly speaking that is what dns etc 
 sees?)

 how dose BSD define this? how does one define this using BSD?

 Hey, sounds like you understand things so well you see the void in the 
 forest. As a newbie I'm still just trying to keep my head from 
 twisting off at long enough intervals to define some of the questions. 
 Like, given I have 5 boxes - 1 fbsd 4 windoz though maybe that 
 proportion will change in a time :) - and each has their own ip adr 
 and I have two apaches installed does that mean I can setup a max of 5 
 different domain level websites on my intranet? Or 10? Or infinite 
 (well, this is reality I hope so...)


This is more of an Apache question than a FreeBSD question.  Apache 
allows you to set up virtual hosts on a per-IP basis or with many hosts 
using a single IP address.  So, you are only limited in hosts to the 
restrictions of your hardware and installation of Apache.

Mike
- -- 
Michael K. SmithNoaNet
206.219.7116 (work) 206.579.8360 (cell)
[EMAIL PROTECTED]http://www.noanet.net


-BEGIN PGP SIGNATURE-
Version: PGP 8.0.3

iQA/AwUBP76RfZzgx7Y34AxGEQI2iwCfW4Q/llLkDvSyh2c/bx9Xv5ws52gAniD3
kTcpWMn3tNAkpDUpPPhIpx5L
=RYFc
-END PGP SIGNATURE-

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


hostnames and interfaces

2003-11-20 Thread paul van den bergen
hey all,
I first encountered networking in CISCO land... where IP addresses and host 
names seem to be associated...

what is the freeBSD way?  AFAICS, a machine has a defined name regardless of 
howmany interfaces it has.  if one splits the world up into hosts (one 
interface) and routers (multiple interfaces) can one define multiple 
hostnames?

to expand on this, there is a potential many to many relationship here between 
host names and IP addresses (strickly speaking that is what dns etc sees?)

how dose BSD define this? how does one define this using BSD?


-- 
Dr Paul van den Bergen
Centre for Advanced Internet Architectures
caia.swin.edu.au
[EMAIL PROTECTED]
IM:bulwynkl2002
And some run up hill and down dale, knapping the chucky stones 
to pieces wi' hammers, like so many road makers run daft. 
They say it is to see how the world was made.
Sir Walter Scott, St. Ronan's Well 1824 

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: hostnames and interfaces

2003-11-20 Thread Marty Landman
At 08:17 PM 11/20/2003, paul van den bergen wrote:

to expand on this, there is a potential many to many relationship here 
between
host names and IP addresses (strickly speaking that is what dns etc sees?)

how dose BSD define this? how does one define this using BSD?
Hey, sounds like you understand things so well you see the void in the 
forest. As a newbie I'm still just trying to keep my head from twisting off 
at long enough intervals to define some of the questions. Like, given I 
have 5 boxes - 1 fbsd 4 windoz though maybe that proportion will change in 
a time :) - and each has their own ip adr and I have two apaches installed 
does that mean I can setup a max of 5 different domain level websites on my 
intranet? Or 10? Or infinite (well, this is reality I hope so...)

The daemons are afoot, my ponderings do not affect them.

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
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: hostnames and interfaces

2003-11-20 Thread Luke Kearney
On Thu, 20 Nov 2003 20:42:33 -0500
Marty Landman [EMAIL PROTECTED] granted us these pearls of wisdom:

 At 08:17 PM 11/20/2003, paul van den bergen wrote:
 
 to expand on this, there is a potential many to many relationship here 
 between
 host names and IP addresses (strickly speaking that is what dns etc sees?)
 
 how dose BSD define this? how does one define this using BSD?
 
 Hey, sounds like you understand things so well you see the void in the 
 forest. As a newbie I'm still just trying to keep my head from twisting off 
 at long enough intervals to define some of the questions. Like, given I 
 have 5 boxes - 1 fbsd 4 windoz though maybe that proportion will change in 
 a time :) - and each has their own ip adr and I have two apaches installed 
 does that mean I can setup a max of 5 different domain level websites on my 
 intranet? Or 10? Or infinite (well, this is reality I hope so...)
 
 The daemons are afoot, my ponderings do not affect them.

Hi,
Let me see if I can shed some light on this issue for you. To the best
of my knowledge a FBSD system can have only one hostname however it can
have as many aliases as you wish. The setup of aliases is acheived via
DNS rather than assigning hostnames per interface. Where you have
multiple machines you would assign multiple hostnames whether they be
from different domains or not.

$ host mail.meibin.net
mail.meibin.net is a nickname for kyoto.meibin.net
kyoto.meibin.net has address 220.111.132.28

per the above the actual host name for the system is kyoto, it's FQDN is
kyoto.meibin.net and it has the alias of mail.meibin.net rather than the
host name of mail.meibin.net .

Apache and loads of other software support virtual hosting and defining
a name in an apache configuration has little to do with the actual
underlying system hostname. That being said virtual hosts don't work
well if DNS was not set correctly for them. 

HTH

LukeK

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]