localhost or LAN addresses in /etc/hosts
Bart Silverstrim
bsilver at chrononomicon.com
Mon Dec 15 18:16:02 UTC 2008
Chris G wrote:
> On Mon, Dec 15, 2008 at 12:36:36PM -0500, Bart Silverstrim wrote:
>> Chris G wrote:
>>> On Mon, Dec 15, 2008 at 09:54:13AM -0400, Derek Broughton wrote:
>>>> Chris G wrote:
>>>>
>>> I really don't understand this. I have two printers on my network,
>>> one is an HP7310 which has its own network interface the other is a
>>> laser printer which is accessed via an Axis print server. So, if the
>>> router is providing DHCP and DNS services how does it get to know
>>> about the printers? Presumably when I turn the Axis print server on
>>> it gets an IP address from the router but how does the router know
>>> that it's a printer and/or give it a useful name that I will know
>>> about and be able to use?
>> If I'm reading what you're being explained in the thread correctly...
>>
>> If you have devices looking for your printer *by name*, then it doesn't
>> matter what their name is if assigned reliably via DHCP and updated in
>> DNS. You can name it Print-1 and no matter what the IP, if the DNS is
>> updated correctly each time the printer gets the IP from the DHCP server
>> you have the ability to find it by asking the network for Print-1.
>>
> Where/what do I tell that the printer is called Print-1, this is the
> bit that's not clear to me. Are you saying that I should give it this
> name in teh router configuration?
If your router has the integrated DHCP and DNS servers, and the
functions to tie a MAC address to a DHCP assignment, you'd do it there
normally.
>> I personally don't do this. I have network printers on a static IP and
>> set them up on the my systems with a static IP, so I don't need to worry
>> about DNS records or DHCP working properly for devices I don't move around.
>>
> Exactly! Much more sensible and easier IMHO, that's why I do it this
> way too. :-)
On small networks it doesn't hurt. It comes down to what you want to do
to manage it and your environment.
>> Because you'd have to edit /etc/hosts on multiple machines if you have
>> multiple machines to administer, or if you have a mixed environment in
>
> Er, no, this is where we came in! I'm using dnsmasq on *one* machine
> in the LAN and that means I only have to edit *one* /etc/hosts and
> dnsmasq tells other machines on the network the contents of that one
> /etc/hosts via DNS.
Just answering why you'd do it or one reason why you'd do it that way...
There are other things that you factor in but I don't know your
environment or anything like that. But again it comes down to
experiences and familiarity, especially for small networks. It's like
asking why anyone needs Active Directory. I hate it. But in our
environment, 98% Windows based, it's almost prerequisite.
At home I have three Mac notebooks, one Mac desktop, an Asus EEE, a
Linux workstation, one Windows system, and a gaggle of virtual testbeds.
Active Directory would be silly to use.
More information about the ubuntu-users
mailing list