Networking Forums

Networking Forums > Computer Networking > Linux Networking > Two Different Formats for hosts File?

Reply
Thread Tools Display Modes

Two Different Formats for hosts File?

 
 
W. Watson
Guest
Posts: n/a

 
      12-06-2004, 11:00 AM
I can find two descriptions on the web for the hosts file that appear to be
different. Here's one:

#
# Hosts file for Virtual Brewery/Virtual Winery
#
# IP local fully qualified domain name
#
127.0.0.1 localhost
#
191.72.1.1 vlager vlager.vbrew.com
191.72.1.1 vlager-if1

and another:

# For loopbacking.
127.0.0.1 localhost
#
129.6.15.28 time-a.nist.gov synctime
44.56.26.10 ka1fsb.ampr.org ka1fsb
44.56.26.11 ka1fsb-3.ampr.org ka1fsb-3

Can someone explain this? Is there another file that controls the order?

My man page for hosts shows: ip-address canonical_hostname aliases

but gives no explanation of canonical_hostname
--
Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
(Formerly Homo habilis, erectus, heidelbergensis and now sapiens)

"The free market is a great thing--we should try it sometime."
-- Jim Hightower

Web Page: <home.earthlink.net/~mtnviews>

 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      12-06-2004, 11:19 AM
On Mon, 06 Dec 2004 12:00:26 GMT, W. Watson wrote:
> I can find two descriptions on the web for the hosts file that appear to be
> different. Here's one:
>
> #
> # Hosts file for Virtual Brewery/Virtual Winery
> #
> # IP local fully qualified domain name
> #
> 127.0.0.1 localhost
> #
> 191.72.1.1 vlager vlager.vbrew.com
> 191.72.1.1 vlager-if1
>
> and another:
>
> # For loopbacking.
> 127.0.0.1 localhost
> #
> 129.6.15.28 time-a.nist.gov synctime
> 44.56.26.10 ka1fsb.ampr.org ka1fsb
> 44.56.26.11 ka1fsb-3.ampr.org ka1fsb-3
>
> Can someone explain this? Is there another file that controls the order?
>
> My man page for hosts shows: ip-address canonical_hostname aliases
>
> but gives no explanation of canonical_hostname


Think about it a minute, why would you want an aliases longer than the
canonical_hostname. The canonical_hostname is the Fully Qualified
Domain Name (FQDN) . Looking at the man page on Mandrakelinux the examples
should prove it to you.

EXAMPLE
127.0.0.1 localhost
192.168.1.10 foo.mydomain.org foo
192.168.1.13 bar.mydomain.org bar
216.234.231.5 master.debian.org master
205.230.163.103 www.opensource.org
 
Reply With Quote
 
W. Watson
Guest
Posts: n/a

 
      12-06-2004, 02:19 PM
Bit Twister wrote:

> On Mon, 06 Dec 2004 12:00:26 GMT, W. Watson wrote:
>
>>I can find two descriptions on the web for the hosts file that appear to be
>>different. Here's one:
>>
>>#
>># Hosts file for Virtual Brewery/Virtual Winery
>>#
>># IP local fully qualified domain name
>>#
>>127.0.0.1 localhost
>>#
>>191.72.1.1 vlager vlager.vbrew.com
>>191.72.1.1 vlager-if1
>>
>>and another:
>>
>># For loopbacking.
>>127.0.0.1 localhost
>>#
>>129.6.15.28 time-a.nist.gov synctime
>>44.56.26.10 ka1fsb.ampr.org ka1fsb
>>44.56.26.11 ka1fsb-3.ampr.org ka1fsb-3
>>
>>Can someone explain this? Is there another file that controls the order?
>>
>>My man page for hosts shows: ip-address canonical_hostname aliases
>>
>>but gives no explanation of canonical_hostname

>
>
> Think about it a minute, why would you want an aliases longer than the
> canonical_hostname. The canonical_hostname is the Fully Qualified
> Domain Name (FQDN) . Looking at the man page on Mandrakelinux the examples
> should prove it to you.
>
> EXAMPLE
> 127.0.0.1 localhost
> 192.168.1.10 foo.mydomain.org foo
> 192.168.1.13 bar.mydomain.org bar
> 216.234.231.5 master.debian.org master
> 205.230.163.103 www.opensource.org

So you're saying that if the FQDN appears, then the aliases follow it, and if there
is no FQDN all names are aliases? Or more likely from the two examples above, both
aliases and one FQDN can follow the IP, but in any order. I'm a RHL 9 user.

--
Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
(Formerly Homo habilis, erectus, heidelbergensis and now sapiens)

"The free market is a great thing--we should try it sometime."
-- Jim Hightower

Web Page: <home.earthlink.net/~mtnviews>
 
Reply With Quote
 
Bill Unruh
Guest
Posts: n/a

 
      12-06-2004, 04:02 PM
"W. Watson" <(E-Mail Removed)> writes:

]I can find two descriptions on the web for the hosts file that appear to be
]different. Here's one:

]#
]# Hosts file for Virtual Brewery/Virtual Winery
]#
]# IP local fully qualified domain name
]#
]127.0.0.1 localhost
]#
]191.72.1.1 vlager vlager.vbrew.com
]191.72.1.1 vlager-if1

]and another:

]# For loopbacking.
]127.0.0.1 localhost
]#
]129.6.15.28 time-a.nist.gov synctime
]44.56.26.10 ka1fsb.ampr.org ka1fsb
]44.56.26.11 ka1fsb-3.ampr.org ka1fsb-3

]Can someone explain this? Is there another file that controls the order?

What is there to explain? The first name is the one delivered if hosts is
queried for the name .

 
Reply With Quote
 
Bill Unruh
Guest
Posts: n/a

 
      12-06-2004, 04:05 PM
"W. Watson" <(E-Mail Removed)> writes:

]So you're saying that if the FQDN appears, then the aliases follow it, and if there
]is no FQDN all names are aliases? Or more likely from the two examples above, both
]aliases and one FQDN can follow the IP, but in any order. I'm a RHL 9 user.

Yes. any order. If the host file is queried with a name, the address is
delivered if that name appears anywhere in the line before a #.
If the hosts file is queried with an address, then the first name is
delivered.

 
Reply With Quote
 
Paul Colquhoun
Guest
Posts: n/a

 
      12-06-2004, 09:40 PM
On Mon, 06 Dec 2004 12:00:26 GMT, W. Watson <(E-Mail Removed)> wrote:
| I can find two descriptions on the web for the hosts file that appear to be
| different. Here's one:
|
| #
| # Hosts file for Virtual Brewery/Virtual Winery
| #
| # IP local fully qualified domain name
| #
| 127.0.0.1 localhost
| #
| 191.72.1.1 vlager vlager.vbrew.com
| 191.72.1.1 vlager-if1
|
| and another:
|
| # For loopbacking.
| 127.0.0.1 localhost
| #
| 129.6.15.28 time-a.nist.gov synctime
| 44.56.26.10 ka1fsb.ampr.org ka1fsb
| 44.56.26.11 ka1fsb-3.ampr.org ka1fsb-3
|
| Can someone explain this? Is there another file that controls the order?
|
| My man page for hosts shows: ip-address canonical_hostname aliases
|
| but gives no explanation of canonical_hostname


What you actually have is:

ip-address list-of-host-names

When you do a lookup on a name, it will match on any name in the list,
and return the IP address. This search will only return an *exact* match
for a full name.

When you do a lookup on an IP address it
will only return the first name from the list.

Most applications work best when the IP to name request returns the
fully-qualified domain name (ie, the full name with all the domain
information). The remaining names in the list are available for shortcut
and abreviations so you don't have to type the full name every time.


--
Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
Asking for technical help in newsgroups? Read this first:
http://catb.org/~esr/faqs/smart-questions.html#intro
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone video formats and music file formats FAQs phonew Wireless Internet 6 07-08-2007 06:57 AM
DVD File Structure & Formats Windows Networking 3 09-06-2006 03:04 PM
hosts file Mike Windows Networking 6 01-08-2005 11:17 PM
Hosts file in win 98 SE LBJ Windows Networking 1 12-10-2003 03:19 AM
hosts file frank neuner Windows Networking 1 10-08-2003 07:31 PM



1 2 3 4 5 6 7 8 9 10 11