Networking Forums

Networking Forums > Computer Networking > Linux Networking > Name resolution for local names using DHCP

Reply
Thread Tools Display Modes

Name resolution for local names using DHCP

 
 
Charles Russell
Guest
Posts: n/a

 
      12-16-2007, 07:20 PM
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?
 
Reply With Quote
 
 
 
 
Jack Snodgrass
Guest
Posts: n/a

 
      12-16-2007, 10:01 PM
On Sun, 16 Dec 2007 14:20:28 -0600, 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?


the DHCP server will assign ( if you tell it too ) the address
of your DNS server. It can be the same server as your DHCP Server
or it can be some other server.

My dhcp server is configured to tell the dhcp clients the dns ip
address they are supposed to use and that's what they use...

you should be able to look at the /etc/resolv.conf file ( for linux
) to see what DNS server it's using and do iptables /all ( I think
that's it ) on windows to see what DNS it is using.


--
D.A.M. - Mothers Against Dyslexia

see http://www.jacksnodgrass.com for my contact info.

jack - Grapevine/Richardson
 
Reply With Quote
 
Charles Russell
Guest
Posts: n/a

 
      12-17-2007, 12:43 AM
Jack Snodgrass wrote:
> On Sun, 16 Dec 2007 14:20:28 -0600, 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?

>
> the DHCP server will assign ( if you tell it too ) the address
> of your DNS server. It can be the same server as your DHCP Server
> or it can be some other server.
>
> My dhcp server is configured to tell the dhcp clients the dns ip
> address they are supposed to use and that's what they use...
>
> you should be able to look at the /etc/resolv.conf file ( for linux
> ) to see what DNS server it's using and do iptables /all ( I think
> that's it ) on windows to see what DNS it is using.
>
>

/etc/resolv.conf (created by dhcpcd) contains the IP address of the
wireless router, which I think has a built-in DHCP server. With this
configuration, DNS resolution works fine for the internet. It just
doesn't work for the local hosts on my WLAN.
 
Reply With Quote
 
Jerry McBride
Guest
Posts: n/a

 
      12-17-2007, 12:46 AM
Charles Russell wrote:

> Jack Snodgrass wrote:
>> On Sun, 16 Dec 2007 14:20:28 -0600, 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?

>>
>> the DHCP server will assign ( if you tell it too ) the address
>> of your DNS server. It can be the same server as your DHCP Server
>> or it can be some other server.
>>
>> My dhcp server is configured to tell the dhcp clients the dns ip
>> address they are supposed to use and that's what they use...
>>
>> you should be able to look at the /etc/resolv.conf file ( for linux
>> ) to see what DNS server it's using and do iptables /all ( I think
>> that's it ) on windows to see what DNS it is using.
>>
>>

> /etc/resolv.conf (created by dhcpcd) contains the IP address of the
> wireless router, which I think has a built-in DHCP server. With this
> configuration, DNS resolution works fine for the internet. It just
> doesn't work for the local hosts on my WLAN.


The router picksup an IP address via dhcp fromm your IP provider. It also
get's the DNS addresses from you IP provider... then as you add clients to
your network, the router hands each of them an IP address and then provides
the DNS addresses it got from your IP provider. That means... the router
KNOWS NOTHING about your local lan.

What you need to do, is setup your OWN DNS resource and add your client IP
and hostnames to it... then configure your router to hand out the address
of your own DNS instead of passing though the ones from your IP provider.

Cheers.




--

Jerry McBride ((E-Mail Removed))
 
Reply With Quote
 
ray
Guest
Posts: n/a

 
      12-17-2007, 02:30 AM
On Sun, 16 Dec 2007 14:20:28 -0600, 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?


No offense, but on a home lan why do you need dhcp? Why not assign
everything static addresses? Works a lot simpler that way.

 
Reply With Quote
 
Charles Russell
Guest
Posts: n/a

 
      12-17-2007, 02:44 AM
Jerry McBride wrote:
> Charles Russell wrote:
>
>> Jack Snodgrass wrote:
>>> On Sun, 16 Dec 2007 14:20:28 -0600, 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?
>>> the DHCP server will assign ( if you tell it too ) the address
>>> of your DNS server. It can be the same server as your DHCP Server
>>> or it can be some other server.
>>>
>>> My dhcp server is configured to tell the dhcp clients the dns ip
>>> address they are supposed to use and that's what they use...
>>>
>>> you should be able to look at the /etc/resolv.conf file ( for linux
>>> ) to see what DNS server it's using and do iptables /all ( I think
>>> that's it ) on windows to see what DNS it is using.
>>>
>>>

>> /etc/resolv.conf (created by dhcpcd) contains the IP address of the
>> wireless router, which I think has a built-in DHCP server. With this
>> configuration, DNS resolution works fine for the internet. It just
>> doesn't work for the local hosts on my WLAN.

>
> The router picksup an IP address via dhcp fromm your IP provider. It also
> get's the DNS addresses from you IP provider... then as you add clients to
> your network, the router hands each of them an IP address and then provides
> the DNS addresses it got from your IP provider. That means... the router
> KNOWS NOTHING about your local lan.
>


If I log on to the router and select status - local network - dhcp -
clients, the router returns a table of IP addresses and local hostnames.
So the information is there, if I knew how to access it automatically. I
can get it manually and put it in /etc/hosts, but then it can change
whenever DHCP reassigns leases.

> What you need to do, is setup your OWN DNS resource and add your client IP
> and hostnames to it...
> then configure your router to hand out the address
> of your own DNS instead of passing though the ones from your IP provider.


How does that work? I thought that the hostname - IP address
association must be obtained somehow from the DHCP server, since the
DHCP server assigns the IP addresses, and they are not constant.
 
Reply With Quote
 
Charles Russell
Guest
Posts: n/a

 
      12-17-2007, 05:11 AM
ray wrote:
> On Sun, 16 Dec 2007 14:20:28 -0600, 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?

>
> No offense, but on a home lan why do you need dhcp? Why not assign
> everything static addresses? Works a lot simpler that way.
>


I'm just groping my way along with network configuration. I used a Unix
network at work for ten years, but we had a system administrator who
handled the configuration.

I chose the default configuration in the setup software for my Linksys
wireless router, without having any idea what was going on, and ended up
with DHCP. Afterward I looked up DHCP in Wikipedia, to try to grasp what
was happening.

In the Knoppix FAQ's I found DHCP recommended strongly as simplifying
network setup. Indeed, with DHCP everything now works - with the
exception of resolving local names, which is a nuisance but can be dealt
with manually.

Am I not just missing some simple configuration detail? Would it really
be simpler to assign static IP's? I think the Knoppix FAQ mentioned
that DHCP does a few more things than just assign IP addresses.

With DHCP everything now works - with the exception of resolving local
names. This is a nuisance, but is not critical since I can enter an
explicit IP for ftp and ssh. Name resolution for shared Windows
directories is working OK, presumably mediated by the Windows SMB
server; smbclient finds the target machine by hostname even though I
can't ping it except by explicit IP address. I don't know how much of
this would be affected if I dropped DHCP.

 
Reply With Quote
 
Ashish Shukla आशीष शुक्ल
Guest
Posts: n/a

 
      12-17-2007, 08:59 AM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charles Russell wrote:
> Jerry McBride wrote:


[...]

>> What you need to do, is setup your OWN DNS resource and add your client
>> IP and hostnames to it...
>> then configure your router to hand out the address
>> of your own DNS instead of passing though the ones from your IP provider.

>
> How does that work? I thought that the hostname - IP address
> association must be obtained somehow from the DHCP server, since the
> DHCP server assigns the IP addresses, and they are not constant.


All you need is a DHCP server capable of doing Dynamic Updates in the
DNS[1]. ISC dhcpd[2] is one such DHCP server which supports this, and ISC
bind[3] is one such DNS server which supports dynamic updation.

So client has to send its hostname to the DHCP server, and DHCP will map
client's IP to its hostname in the DNS server.

References:
[1] - http://tools.ietf.org/html/rfc2136
[2] - http://www.isc.org/products/DHCP/
[3] - http://www.isc.org/products/BIND/

HTH
- --
Ashish Shukla आशीष शुक्ल http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHZkiUHy+EEHYuXnQRAuccAJ9doV2pzbioCG1bVtDmeq YHnAHIiACguqL1
PpTI5ki/G5CBjhmDm7UsnRI=
=8ZVz
-----END PGP SIGNATURE-----
 
Reply With Quote
 
Max
Guest
Posts: n/a

 
      12-17-2007, 09:09 AM
Charles Russell schreef:
> ray wrote:
>> On Sun, 16 Dec 2007 14:20:28 -0600, 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?

>>
>> No offense, but on a home lan why do you need dhcp? Why not assign
>> everything static addresses? Works a lot simpler that way.
>>

>
> I'm just groping my way along with network configuration. I used a Unix
> network at work for ten years, but we had a system administrator who
> handled the configuration.
>
> I chose the default configuration in the setup software for my Linksys
> wireless router, without having any idea what was going on, and ended up
> with DHCP. Afterward I looked up DHCP in Wikipedia, to try to grasp what
> was happening.
>
> In the Knoppix FAQ's I found DHCP recommended strongly as simplifying
> network setup. Indeed, with DHCP everything now works - with the
> exception of resolving local names, which is a nuisance but can be dealt
> with manually.
>
> Am I not just missing some simple configuration detail? Would it really
> be simpler to assign static IP's? I think the Knoppix FAQ mentioned
> that DHCP does a few more things than just assign IP addresses.
>
> With DHCP everything now works - with the exception of resolving local
> names. This is a nuisance, but is not critical since I can enter an
> explicit IP for ftp and ssh. Name resolution for shared Windows
> directories is working OK, presumably mediated by the Windows SMB
> server; smbclient finds the target machine by hostname even though I
> can't ping it except by explicit IP address. I don't know how much of
> this would be affected if I dropped DHCP.
>

If you are using Knoppix as a DHCP server, you must be able to control
how DHCP works in /etc/dhcpd.conf
In this file you can configure the daemon so that it will give the same
address to your computers depending on their MAC address. This way you
will have the best of two worlds. You can add these IP-addresses to the
/etc/hosts files of your computers or you can run BIND yourself.

Good luck,

--
Max

Open Source is an ode to common sense
 
Reply With Quote
 
david
Guest
Posts: n/a

 
      12-17-2007, 09:25 AM
On Sun, 16 Dec 2007 19:43:27 -0600, Charles Russell rearranged some
electrons to say:

> Jack Snodgrass wrote:
>> On Sun, 16 Dec 2007 14:20:28 -0600, 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?

>>
>> the DHCP server will assign ( if you tell it too ) the address of your
>> DNS server. It can be the same server as your DHCP Server or it can be
>> some other server.
>>
>> My dhcp server is configured to tell the dhcp clients the dns ip
>> address they are supposed to use and that's what they use...
>>
>> you should be able to look at the /etc/resolv.conf file ( for linux )
>> to see what DNS server it's using and do iptables /all ( I think that's
>> it ) on windows to see what DNS it is using.
>>
>>

> /etc/resolv.conf (created by dhcpcd) contains the IP address of the
> wireless router, which I think has a built-in DHCP server. With this
> configuration, DNS resolution works fine for the internet. It just
> doesn't work for the local hosts on my WLAN.


You could just assign fixed IP addresses. Then you could use /etc/hosts.
 
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
DNS: Query of local names! Paulo da Silva Linux Networking 1 03-20-2010 02:51 AM
DNS resolution of local DHCP-configured hosts w/ Westell Versalink Matej Cepl Network Routers 0 12-12-2005 12:56 AM
no name resolution on local domain Volker Jesinghaus Linux Networking 3 11-09-2004 02:39 AM
DSN Names for local intranet sites Brian Henry Windows Networking 0 09-28-2004 08:48 PM
NetBIOS Names Resolution Bob Simon Linux Networking 0 08-05-2004 04:49 PM



1 2 3 4 5 6 7 8 9 10 11