Joe Rosevear wrote:
>> What is a simple way in Slackware to set up the ability to
>> refer to other boxes in a DHCP-based network by hostname?
Look at dnsmasq, included on your installation CD (and perhaps already
installed on your system). I've not used it myself, though, so you'll
likely have some reading to do, but my understanding is that it can
do exactly this (provide DHCP service that dynamically updates local
DNS service). That said, what you're looking to do, as Henrik Carlqvist
pointed out is *not* "simple". You need to understand how DNS and DHCP
work (or at least how to configure them), and you need to understand
what can go wrong if you don't configure things right.
>> I don't expect to be able to do this:
>>
>> host <hostname>
>>
>> I understand that depends on the DNS.
>>
>> But I would like to be able to do this
>>
>> ssh <hostname> -l <username>
>> and
>> ping <hostname>
You can't do the latter two unless the former works. The first thing
your system will do when you type "ssh <hostname>" is exactly equivalent
to "host <hostname>", because that's how your system knows which other
system you want to ssh to. Computers "know" each other by IP address;
We know them by name.
>> I'm sort of baffled by how it works at my work place. ...
That's going to be a problem, because you need to understand how it
works, if you want to be sure you have it working right. Get experience
with DNS and DHCP first, then worry about combining them.
On Fri, 27 Jan 2012 09:11:39 +0100, Henrik Carlqvist wrote:
> Using fixed IPs is usually preferred for servers. Instead of having
> complete /etc/hosts on every machine you could use some catalog
> service like NIS.
Or DNS, which arguably is easier (or at least more widely understood).
If you have the DHCP server assign fixed addresses, you don't need
dynamic updating on the DNS.
> I wouldn't say that configuring NIS is trivial, but IMHO it would at
> least be easier than configuring dynamic DNS updates from dhcpd.
I wonder. I expect I'd disagree with you, but I've never done DNS
updates from DHCP.
>> I *did* put a line like this in /etc/rc.d/rc.inet1.conf in whiz
>>
>> DHCP_HOSTNAME[0]="whiz"
>> ...
>
> That line makes the machine tell the DHCP server that it should have
> the name whiz. The DHCP server then tells the DNS server about whiz
> and the IP it gave whiz.
... assuming the OP's work place is indeed performing dynamic DNS
updates, yes. Another possibility is that they simply assign static
addressing from their DNS server, and manually update the DNS. That's
certainly much easier to setup, even if it implies continued human
intervention.
> ... I would say that some of the point with DHCP is lost when it
> relies on a correct configuration on the client machines.
Which part are you anticipating "relies on a correct configuration on
the client machines"? DHCP does configure more than the IP address of
the client, unless explicitly made not to.
> I know that some MS Windows administrators still think that DHCP is a
> great idea as they can use DHCP as a catalog service to provide
> information like IP addresses to DNS servers. However, if you have
> plans to change IP addresses of your DNS servers something is
> seriously broken in your plan.
Really? I'm not a Windows administrator, and I've never setup dynamic
DNS updated from DHCP, but I don't see how this is, nor do I see why
this notion would be limitted to Windows administrators. It isn't quite
accurate to state that DHCP can "provide information like IP addresses to
DNS servers," though. The DHCP server can be made to update IP address
to hostname correlation on the DNS server(s). The IP addresses are either
on your network (and resolved by your DNS server(s)) or they aren't.
The DHCP server sends the IP address(es) of the DNS resolver(s) to the
clients with each lease. If you're going to change the IP address(es) of
your resolver(s), simply update the DHCP server configuration accordingly.
Perhaps change one resolver at a time, to ensure continued service with
existing leases, but the plan can be made to work. DHCP indeed *is*
a good idea in a lot of (perhaps even "most"?) situations, and it can
even simplify configuration in an environment that uses static addressing.
--
----------------------------------------------------------------------
Sylvain Robitaille
s...@encs.concordia.ca
Systems analyst / AITS Concordia University
Faculty of Engineering and Computer Science Montreal, Quebec, Canada
----------------------------------------------------------------------