printer suddenly disappeared

Rick Stevens rstevens at internap.com
Fri Jun 1 00:04:56 UTC 2007


On Thu, 2007-05-31 at 19:23 -0400, Buz Davis wrote:
> Thanks to Bret Stern and Ted Potter for their suggestions.  I found the 
> problem and it is me, or at least my ignorance.
> 
> I have been working up to networking several computers, and since I 
> figured they couldn't all be named "localhost.localdomain" had changed
> the host and domain names.  I checked direct internet connection after 
> such changes but didn't realize CUPS would be affected.  Obviously I 
> have a lot to learn.
> 
> CAN computers be networked without changing their hostnames ?

Yes.  The hostnames are primarily to make OUR (meaning humans) lives'
easier.  For example, it's easier for me to "ssh xyclone" than it
is to "ssh 192.168.0.64".

The hostname is grabbed by many programs, then that's looked up via DNS
and the /etc/hosts file to get an IP address.  However, any traffic over
the network is done via the IP address--the host names aren't involved.

By default "localhost" and "localhost.localdomain" refer to the IP
address of 127.0.0.1.  This is generally tied to the pseudo-interface
called "lo" (for "loopback"), and this is reflected by the default
entry in /etc/hosts:

	127.0.0.1	localhost.localdomain localhost

This guarantees that any network-oriented stuff (such as CUPS or X) will
have a hostname to work on, and any network stuff won't leave your box.

Now, when you create a real host name, it must be related to an IP
address somehow.  This can be done via an entry in the /etc/hosts file
or a DNS entry on your DNS server somewhere.  For small, private
networks (less than, say, 20 machines), I tend to maintain an /etc/hosts
file with all the entries in it and ship it to all the nodes rather than
set up a DNS server.  For example, the hosts file on my machines at home
have entries such as:

	127.0.0.1	localhost.localdomain localhost
	192.168.0.1	router
	192.168.0.10	wap
	192.168.0.50	shuttle
	192.168.0.64	xyclone
	192.168.0.92	labrat1
	192.168.0.128	bigdog

and all the machines have their hostnames set appropriately.  xyclone is
the main machine in my network, so it could easily run a DNS server with
these entries in it, and the other machines could set up their
/etc/resolv.conf files to point at it:

	nameserver 192.168.0.64

I'd only have to maintain the DNS server instead of each machine's hosts
file in that case.  It's really a matter of scale.  My network is pretty
static, so it really wouldn't buy me anything to go the DNS route, so I
stick with the hosts files.  Yeah, it's old school and sorta stupid, but
it works.  I always remember my motto, though: "If it's stupid and it
works, it ain't stupid!"

Our company has over 10,000 servers in 10 data centers around the
world, so we run 14 DNS servers (two primaries, six secondaries and six
caches) in different parts of the world.  It's much easier to manage DNS
on the two primaries (and let it propagate to the secondaries and
caches) than thousands of hosts files.  In addition you can do things
like round-robin load balancing, virtual hosting and a bunch of stuff
with DNS you can't do with hosts files.

If you want to "look like a pro", learn and implement DNS.  Doing it on
a small home network is a great way to learn how.  You can also dabble
in DHCP server configuration and dynamic DNS updates from the DHCP
server and really have a good grasp on how the "big dawgs" do it.

----------------------------------------------------------------------
- Rick Stevens, Principal Engineer             rstevens at internap.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-  Any sufficiently advanced technology is indistinguishable from a  -
-                              rigged demo.                          -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list