LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-22-2006, 10:00 PM   #1
pyepye
LQ Newbie
 
Registered: Mar 2006
Distribution: FC4
Posts: 10

Rep: Reputation: 0
FC4: cannot resolve hostnames on local network


I've noticed similar threads, and none of them really have a clear cut solution.

I just installed FC4 onto an old laptop and just set up my wireless card to connect to the router. The other computers on the network are all running XP through DHCP. The problem is that I can't figure out why I can't resolve any hostnames on the local network; while everything on the internet works fine. Pinging by IP works as it should as well.

My resolv.conf is pretty standard:
nameserver 192.228.22.70
nameserver 192.228.22.71

I haven't set up samba yet if that makes any differnce.

Any pointers would be awesome.
 
Old 03-22-2006, 10:39 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Do the nameservers of 192.228.22.7[01] contain records for your LAN? If not, there's no way for the records to be retrieved.
 
Old 03-22-2006, 11:43 PM   #3
pyepye
LQ Newbie
 
Registered: Mar 2006
Distribution: FC4
Posts: 10

Original Poster
Rep: Reputation: 0
No... The name servers I have listed are public root DNS servers I believe. So you're right, they won't have any of the hostnames on my local network.

But since I don't have a local DNS server, I can't just put that nameserver as the first one in /etc/resolv.conf. So the question now becomes how can I configure my box such that it queries the local network to see if the machine name is there before giving up?
 
Old 03-24-2006, 09:02 PM   #4
pyepye
LQ Newbie
 
Registered: Mar 2006
Distribution: FC4
Posts: 10

Original Poster
Rep: Reputation: 0
bump bump bump.
 
Old 03-24-2006, 11:24 PM   #5
buaku
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2 (2.4.31)
Posts: 111

Rep: Reputation: 15
I take it your router is dishing out the addresses to the computers behind it?

I don't know too much about this stuff but it would seem for you to use your hostnames on your network you'd need to run your own DNS server or set up all the ips/hosts in the /etc/hosts file. The problem I see is you're using dhcp so your ip address could theoretically change so the ips and hosts may not match up after awhile possibly.

I'm not sure how to handle that when it comes to dhcp.
 
Old 03-25-2006, 08:18 AM   #6
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 43
If your router is providing the DHCP service it should run some sort of DNS proxy service. That service should forward Internet name lookups on to your ISP's servers for resolution, but scan it's own DHCP leases for local names and addresses. Check what information the DHCP server is providing to the XP boxes - if the nameserver address is the same as the router and the XP boxes work as you want, then the router has such a service. All you need to do then is configure the Linux box to use the same DHCP service and it will configure itself in the same way.

The alternative is to set up DHCP and DNS services on the Linux box and turn off the DHCP server on the router. The ISC DHCP and DNS packages can be linked to dynamically update the DNS information from DHCP leases but it's a lot of work for little gain.

Good luck,

--DaveG
 
Old 03-25-2006, 11:44 PM   #7
pyepye
LQ Newbie
 
Registered: Mar 2006
Distribution: FC4
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks backu and DaveG for the pointers.

To answer the questions, yes, the router is running the DCHP and providing the IPs to the boxes on the network. I have one XP box that has a static IP (since it's always on), and I've added an entry into the /etc/hosts file to point to that machine. However, there are many other XP laptops that come and go on my network (roommates, friends and my other laptop) and they have dynamic IP addresses handed out by the DHCP.

Now, I know I could have the linux box act as my DHCP/DNS server, but I've put it onto my laptop and it's not going to be running 24/7. So that's not a viable option; so the DCHP must stay on the router. As for your question, Dave, about whether the router itself provides DNS services; I'm not quite sure how I can check this. A few pointers here maybe?

EDIT: I did an ipconfig /all on my XP box and it seems like the DNS servers are passed directly from my router to the XP box. Here's the relevant portion:

Code:
IP Address. . . . . . . . . . . . : 192.168.0.10
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 206.47.244.101
                                    67.69.184.88
Now I suppose the question is to ask, how might my XP boxes be able to type in a particular hostname of another computer on the network and be able to resolve it to an IP? How can I duplicate this on FC4?

Also, why does my router show the hostnames of my windows clients but says "unknown" (a generic hostname) for my linux laptop?

Thanks!

Last edited by pyepye; 03-25-2006 at 11:53 PM.
 
Old 03-27-2006, 04:35 AM   #8
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 43
Hmm.

The Windows boxes may be using WINS to look up local IP names and addresses. If so, the only option would be to set up Samba on the Linux box and configure nsswitch to use WINS before DNS. e.g. /etc/nsswitch.conf:
...
hosts: files wins dns
...

If you already have Samba set up then the nsswitch change might fix things. Worth a try!

To have the Linux DHCP client send it's host name, add the following to /etc/dhclient.conf (I use FC4, your's may be different):
interface "eth0" {
send host-name "mylinux";
send dhcp-client-identifier 1:ff:e0:29:9f:0f:b5;
}

The host name should be the Linux host name (hostname(1)). The identifier is your ethernet hardware address for the interface with a "1:" prefix. This is handy for dual-boot so you get the same lease as Windows.

Hope this helps.

--DaveG.
 
Old 03-29-2006, 09:53 AM   #9
pyepye
LQ Newbie
 
Registered: Mar 2006
Distribution: FC4
Posts: 10

Original Poster
Rep: Reputation: 0
DaveG, your instructions were perfect! I got my linux box resolving local hostnames now.

Just in case anyone else comes to look for a quick solution:
1) Install Samba
2) Enable WINS
3) Edit /etc/nsswitch.conf to use WINS before DNS resolution
4) Edit /etc/dhclient.conf to have Linux send out the hostname of the client connecting through DHCP

Everything was where it should be except for dhclient.conf, which I had to create.
 
Old 03-29-2006, 11:41 PM   #10
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 43
Glad it worked out, happy to help.

Please be aware that Samba can make your Linux system as insecure as a Windows box if you're not careful with the configuration. The documentation is LONG, but there are plenty of example configurations.

--DaveG
 
Old 03-30-2006, 08:32 PM   #11
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Rep: Reputation: 0
I'm trying to do something similar, except i need to access computers on my lan from the wan with their host name for the local computers...
I've got iptables working and can get to the computers with my.ip.ad.dy:port designations for the computers, but when trying to point a fwd with my DNS server hosted elsewhere they only allow forward of http://my.ip.ad.dy:port and this will not work since http is not the protocol used by remote desktop. So what I need is to have local-computer-on-lan.mydomain.com point to my.ip.ad.dy then have my slackbox know that local-computer-on-lan.mydomain.com really points to 192.168.x.x... I have 2 nics in my slackware box.
eth0 is wan
eth1 is lan and dhcp
this is my config so far:
Quote:
interface "eth0" {
send host-name "xxxxx-work";
send dhcp-client-indentifier xx:xx:xx:xx:xx:xx;
}
am i even going about this the right way??

Last edited by smarthouseguy; 03-30-2006 at 10:25 PM.
 
Old 04-03-2006, 12:37 PM   #12
pyepye
LQ Newbie
 
Registered: Mar 2006
Distribution: FC4
Posts: 10

Original Poster
Rep: Reputation: 0
Confusing question, and I apologize in advance if I misunderstood what you're trying to do; but can't your theoretically just add a line to your /etc/hosts with that information? e.g.

local-computer-on-lan.mydomain.com 192.168.x.x

Cheers
 
Old 04-05-2006, 12:29 PM   #13
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Rep: Reputation: 0
Quote:
Originally Posted by pyepye
Confusing question, and I apologize in advance if I misunderstood what you're trying to do; but can't your theoretically just add a line to your /etc/hosts with that information? e.g.

local-computer-on-lan.mydomain.com 192.168.x.x

Cheers

OK... let me reword this...
I have a static public ip connected to eth0 on my box on eth1 i have my lan 192.168.x.x using dhcpd and iptables what I am trying to accomplish is when i want to go to work.mydomain.com it will resolve the name on eth0 and pass it through to 192.168.x.x on eth1.
I need it to go there so I can access windows computers with remote desktop with a name insted of my pu.bl.ic.ip:port. This can't be accomplished with the dns server hosting our website since fwds end up being http://pu.bl.ic.ip:port the http:// causes issues since rdp is not http. so I'm hoping that doing what you suggested will work.

Do I need to setup some kind of dns server on my linux box to help with this?

Also, when I set up the DNS at the nameserver for the domain will i just have work.mydomain.com point to pu.bl.ic.ip ?

Last edited by smarthouseguy; 04-05-2006 at 12:33 PM.
 
  


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
Can't resolve hostnames....need help shaggystyle Linux - Networking 2 08-28-2004 02:20 AM
Getting hostnames known in the local network javeree Linux - Networking 4 08-04-2004 05:39 AM
Cannot resolve local addresses on local network danielgrenyer Linux - Networking 6 01-14-2004 11:03 AM
Sendmail can't resolve names outside local network beng Linux - Networking 4 12-01-2003 12:09 PM
resolve hostnames zero_kewl Linux - General 5 09-01-2003 04:00 AM


All times are GMT -5. The time now is 09:17 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