Re: Name resolution for local names using DHCP



Robert Harris <robert.f.harris@xxxxxxxxxxxxxxxx> writes:

Charles Russell wrote:
Unruh wrote:
Charles Russell <NOSPAM@xxxxxxxxxxxxx> writes:

Unruh wrote:
Charles Russell <NOSPAM@xxxxxxxxxxxxx> writes:

Charles Russell wrote:
I can't figure out how to get name resolution for computers on my
home WLAN, though everything works all right if I type in explicit
IP addresses. The IP addresses will vary because of DHCP, so I
can't simply put them in /etc/hosts.

The hostnames and IP addresses are all known to the router
(Linksys wrt54g), as I can confirm by querying the router. Should
the router not resolve these local hostnames? Or do I
misunderstand how this should work under DHCP?
Thanks for the responses, everybody. I infer that there is no
simple fix within the capability of the DHCP server in my $50
Linksys wrt54g router. Given that there is no simple fix, and that
the only problem is that I have to manually enter IP addresses
whenever I do local ftp or ssh, I think I'll follow the principle:
"If it ain't broke (much), don't fix it (much)."
Some routers allow you to tell the dhcp service on the router to
allways
assign ip address X to MAC address Y. Look through the manual to see if
your router allows that.


Yes, it does. But why should static IP addresses be required, when
the DHCP server already has the hostname-IP address associations it
needs to resolve the local hostname?

You have become fixated on your particular solution to the problem.
Let go.
Or spend you life trying to persuade Linksys to do it your way.


Just trying to understand a bit more about networking, and to find the
simplest solution to a noncritical problem.

OK, static addresses.

Thanks.
I know I'm jumping in late, but static addresses are not a terribly good
idea - they don't scale in the sense that if you add another computer to
a network of n machines, then you have to change the /etc/hosts file of
all n existing machines.

It depends on what the value of n is. If it is 3 then that is not a problem
If it is 10 or 1000 then it is. Most homes have at most 3 computers.
YOu can also write a script to transfer the /etc/hosts file to all machines
when needed.
Also you could set up one of the machines as a dns server and use it to
resolve for the others. This is much more work than updating /etc/hosts
once a year for 3 machines. If you have 10 or 100 or more, then it may well
be the way to go.


1. Are you sure that your router can't to hostname to IP address
translations? It may just be that it has a wrong idea of your domain
names. If the host name of another computer is, say, machine, try to
resolve (e.g. with the command hosts):

The amount of time he has already spent just typing his queries exceeds the
work of updating /etc/hosts for the next 5 years.



machine.

(the following dot will stop your own computer appending its own idea of
the domain name)

Otherwise, look at the router's idea of the domain name and try to resolve:

machine.domain.name.

(if the domain name is domain.name)

Of course that may not work either, but it will test whether your router
can resolve local hostnames.

2. Run avahi. Then each machine will advertise its own hostname and IP
address and you will be able to resolve say, machine, as machine.local

Robert
.



Relevant Pages

  • Re: [Info-vax] my vax goes to internet
    ... I tried to use fixed address, that was how my local machines were ... I did not succeed in making the router route fixed address. ... Very few uses DHCP with their VMS systems. ...
    (comp.os.vms)
  • Re: One Way Samba-Solved
    ... a small home/business DSL network - they may be of help, ... the same subnet as the gateway router. ... I use the routers dhcp server to issue dhcp for a visiting laptop ... outside of the range of my fixed machines. ...
    (Ubuntu)
  • Re: Name resolution for local names using DHCP
    ... The IP addresses will vary because of DHCP, ... The hostnames and IP addresses are all known to the router, as I can confirm by querying the router. ... the router not resolve these local hostnames? ...
    (comp.os.linux.networking)
  • Re: Cant Navigate My LAN Or Ping
    ... OTOH I would always prefer DHCP, even if the DHCP server is ... IPs on this side of the router since day one. ... With "this side of the router" you mean the addresses for your machines? ... that is usually your private network and not addresses provided by ...
    (Ubuntu)
  • Re: Static IP address assignments [WAS Re: NIC Settings for IBM Thinkpad T30 / wired & wireless]
    ... almost all routers provide IP addresses via DHCP. ... And your router _gets_ those dynamic IPs via DHCP. ... And why do that when you only have a few machines instead of just ... some problem or another using hosts & dhcp. ...
    (Ubuntu)