LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-16-2005, 01:50 PM   #1
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
slackware dhcpcd client?


My dhcpcd client thinks my d-link router is a namsever?

Quote:
$ netconfig
hostname = localhost
domain = localdomain
... select dhcp
dhcp hostname = localhost
... accept

cat /etc/resolv.conf
nameserver 192.168.0.1
search xxx.xxx.xxx.net

umm, sorry linux dhcp client, my router at 192.168.0.1 is not a nameserver. However, it does have the DNS IP's, so why don't you ask it and it will kindly give them to you. Linux dhcp client says I don't know how to ask it politely. Why don't you tell me how?

Right now I'm runnig a static config w/ puting in dns ip into the resolv.conf manually. I would like to get this dhcp working properly though?
 
Old 03-16-2005, 02:42 PM   #2
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 927

Rep: Reputation: 30
In /etc/rc.d/rc.inet1, you should be able to change $USE_DHCP to "Yes", configure any other options you may find interesting, and restart your ethernet interface via ifconfig.
If that works, I'd just manually remove your router's IP from resolv.conf - it probably isn't doing any harm, but it probably isn't helping either :-)
 
Old 03-16-2005, 02:55 PM   #3
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by rose_bud4201
If that works, I'd just manually remove your router's IP from resolv.conf - it probably isn't doing any harm, but it probably isn't helping either :-)


Manually remove the ip from resolv.conf and replace with real DNS servers???????????????????????????

THAT MISSES THE WHOLE POINT OF MY QUESTION? THE WHOLE POINT is that the dhcp client thinks that 192.168.0.1, my router, is a nameserver. I want the dhcp client to talk to the router and get the real DNS ip's and put them into resolv.conf automatically.
 
Old 03-16-2005, 04:03 PM   #4
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 30
Quote:
umm, sorry linux dhcp client, my router at 192.168.0.1 is not a nameserver. However, it does have the DNS IP's, so why don't you ask it and it will kindly give them to you. Linux dhcp client says I don't know how to ask it politely. Why don't you tell me how?
If your router is providing DHCP services, it's entirely possible that it's also providing DNS services as a caching or redirect server. Such a service wouldn't be beyond the realms of plausibility, considering that my own D-Link "router" (which is being used as a hub and print server, atm) has that capability.

Are you able to resolve FQDN's with the setting the way the DHCP client seems to be setting it?
 
Old 03-16-2005, 04:26 PM   #5
djbanaan
Member
 
Registered: Aug 2003
Location: Haarlem, The Netherlands
Distribution: Slackware, FreeBSD
Posts: 178

Rep: Reputation: 30
killerbob is right. It is not dhcpcd that "thinks" 192.168.0.1 is a valid DNS server, it is your router's DHCP server that passes this address as a DNS server. In fact, this is a pretty common thing for a router to do, because caching DNS entries on the router can speed up name resolution.

The question remains, of course, whether this set up is working for you or not. Some routers will allow you to disable DNS caching/ forwarding and have their built-in DHCP server assign the ISP's DNS server addresses to your DHCP client.

On another note, I think there is no need TO SHOUT at someone who's trying to help you with your problem.
 
Old 03-16-2005, 04:32 PM   #6
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
Yes you are indeed correct the router at 192.168.0.1 does provide a resolver. However, it is not a very good resolver and takes forever to resolve names. The other computer on the LAN with windows xp can automatically querry the router for the real dns ip's. It is just a matter of getting dhcp client in linux to ask ther router properly for it? And yes if I manually add the DNS names to the resolv.conf file then it works great. However, that is just a hack that bypasses the dhcp client. Any dhcp client worth using is supposed to querry the DHCP server for the real dns names. Otherwise what is the point of using a dhcp?
 
Old 03-16-2005, 04:36 PM   #7
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
And yes it is possible because when windows xp querries the router is does get the real DNS ip's and not the 192.168.0.1 nameserver, which sucks.
 
Old 03-16-2005, 04:41 PM   #8
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
Also, I didn't mean TO SHOUT, it's just that I've been trying to get the dhcp client to get the real DNS ip's for weeks and it is annoying the hell out of me. I am no newbie to linux and it is frustrating me because I con't figure it out.
 
Old 03-16-2005, 05:08 PM   #9
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 30
Are you certain that the Windows box is using dynamic configuration for *all* the options? It is entirely possible for Windows to be on DHCP for network configuration, but to use static configuration for DNS setup.

I ask, because as I understand it, DHCP is DHCP. Period.

DHCP works like this:
1 - Client sends out a DHCP probe packet, on the broadcast address 255.255.255.255.
2 - DHCP server hears the packet, and replies on the same broadcast address with an IP address and the client's MAC address.
3 - Client hears DHCP's response, and switches to using that IP address. It responds directly to DHCP server, asking for netmask, gateway, DNS, lease duration, and anything else that can be configured in DHCP's response.
4 - DHCP server replies with all of the information that it's configured to send out.
5 - Client autoconfigures with the information provided by the DHCP server.
6 - DHCP records the IP address and the MAC address in the leases file, so that it doesn't send out the same IP address to another computer, and so that it can send the same credentials to the same computer if it requests them for renewal or reboots before the lease expires.

If dhcpcd gets more than one answer for the DNS server, it'll put them all in /etc/resolv.conf. Before I switched to an internal DNS server on my network, I had 7 DNS servers in my DHCP configuration, and Linux had them all in /etc/resolv.conf. Windows isn't smart enough to allow more than two DNS servers, and it'll put them in its configuration in the order they arrive in. It's actually possible for a DHCP response to have dozens of DNS servers configured, and there is absolutely no way to structure a DHCP server to give a different response to a different OS, short of having a packet filter that checks the OS signature (like nmap does), and directs the packets to a different server configuration based on the client OS.

Somehow, I don't think that D-Link would have put that kind of smarts into your router....


So the question remains. Are you *certain* that Windows is using dynamic configuration for DNS? Did you install any special software in Windows for the router, that could, conceivably, allow Windows to ask the router for information that isn't sent through DHCP?

And is there a reason that you can't just configure the DNS numbers manually in Linux? If you've already established that it works that way, why trouble yourself with trying to fix it? How many clients are you planning on adding to your network that you have to worry about the small trouble that would cause you over the aggravation of trying to change a DHCP server's request?

Is it enough that you should be considering using a real DHCP server instead of your NAT box?
 
Old 03-16-2005, 06:30 PM   #10
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
Yeah am absolutely 100% positive that the window boxes on the LAN are using dynamic DHCP, I set them up myself. They querry the router for all the information, IP, netmask, gateway, and dns.

Thanks you for all the detailed info. I'm going to put my eht0 into promisc mode and dump the packets and see what is going on here. My understanding is that DHCP is generic so it should just work and be independent of the OS. I'm going to figure this one out.

Quote:
why trouble yourself with trying to fix it?
It's how I am. Yeah, right now I have a static config and it works, but I'm a person that likes to know the nuts and bolts of everything. I'm an Engineer. Not computer by the way. Computers are my hobby and I enjoy it, although sometimes it drives me crazy in the end I will be more knowledgeable for it.

Quote:
Is it enough that you should be considering using a real DHCP server instead of your NAT box?
I'm running a small LAN here and I don't want to have a dedicated computer on 24/7 to do routing/gateway/firewall/DHCP although maybe one day.

Thanks, I'll post back let you know how it goes.
 
Old 03-16-2005, 08:11 PM   #11
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
hmm, interesting this is the pertinent information of my eth0 packet dump when it gets a replay from the router.

BOOTP/DHCP, Reply, length: 548, xid:0xd608075e, flags: [none] (0x0000)
Your IP: 192.168.0.100
Client Ethernet Address: 00:00:xx:xx:xx:xx [|bootp]


as you can see the dhcp router aint sending much? it sends that twice and then that's it. It seems is not even sending any DNS IP's. The dhcp client just assumes one of 192.168.0.1 and puts it in the resolv.conf file.

Now I have to do the same in windows xp, which is going to be harder because I don't know how to get packet dumps in windows xp.
 
Old 03-16-2005, 08:26 PM   #12
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
a way to solve your prob. would be to add the "-R " option to any instance of the " dhcpcd" command
in /etc/rc.d/rc.inet1.
in that case /etc/resolv.conf won't be overwritten, and you can put your own dns-server(s) there.

see " man dhcpcd "

egag
 
Old 03-16-2005, 09:05 PM   #13
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
ahhh the -R option is for wussies

I'm getin this baby to work the right way. Further investigation of my packets tells me it is using the BOOTP protocol rather than the DHCP protocol. Reading on the net and it seems that the BOOTP protocal is a primative one and doesn't do much. So now I have to get my dhcp client to use the more advanced DHCP protocol. Think maybe the one I'm using "dhcpcd" can't do this. I'm going to get a new one. I think the dhclient one looks more advanced. I WILL FIGURE THIS OUT.
 
Old 03-16-2005, 09:15 PM   #14
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 30
Nonsense.... I'm using dhcpcd myself, on my laptop, desktop, and the Linux installation on my mother's computer (that she doesn't know is there ), and I've never had the problems you're describing. I'm getting IP, netmask, DNS, time, and gateway from my DHCP server.

I'm also running a server with dhcpd, rather than using a NAT box.
 
Old 03-16-2005, 09:51 PM   #15
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Original Poster
Rep: Reputation: 31
It's not the "NAT box". Absolutely without a doubt, 100% sure. The router is capable of sending the DNS info as windows xp gets it this way. The dhclient does look a lot more advanced, it has 10,000 options. Can I ask what flags your or passing to dhcpcd?

The BOOTP and DHCP are 2 different protocols as defined here:

http://www.rhyshaden.com/dhcp.htm

From my packet analysis, dhcpcd is only using the bootp protocal. Don't know why?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/sbin/dhcpcd: not running - Slackware 10 jtp51 Slackware 6 10-14-2004 12:40 PM
change default dhcp client to dhcpcd waffe Debian 2 05-11-2004 09:11 PM
Slackware 8 and DHCPCD - Timed out likwid818 Linux - Networking 6 10-22-2003 10:45 PM
DHCPCD / Slackware 8.0 Problem romanivice Linux - Networking 3 02-15-2002 08:26 PM
DHCPCD in Slackware 8.0 Floppy Linux - Networking 3 02-10-2002 07:58 AM


All times are GMT -5. The time now is 07:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration