LinuxQuestions.org
Review your favorite Linux distribution.
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-08-2005, 08:32 PM   #1
jschwartzman
LQ Newbie
 
Registered: Mar 2005
Distribution: opensuse
Posts: 7

Rep: Reputation: 0
SuSE can't ping by hostname


I have a cable modem connected to a router/switch which is also a dhcp server. I have 2 Windows machines and a SuSE Linux 9.2 machine (with the firewall turned off) connected to the switch. I’m also using the Linux machine as a Samba server. My ISP does not allow static routing.

My Windows boxes can ping the Linux box by IP address and by hostname, but SuSE can only ping by IP address and not by hostname. Samba knows all about the Windows hostnames but ping does not.

I don't want to use the hosts file because I configure using dhcp. How can I get Linux to recognize hostnames?
 
Old 03-08-2005, 09:29 PM   #2
jjohnston62
Member
 
Registered: Aug 2003
Location: Minnesota, USA
Distribution: RedHat, Suse
Posts: 106

Rep: Reputation: 15
why?

If your windows boxes can get to the linux server, and that is where you're doing your file storage, why do you care?

Enable WINS support on your Samba server - you don't mention which version of Windows - (2000/XP do name resolution slightly different than 95/98) - but this may bridge the gap between IP/Netbios name resolution.

Jon Johnston
Creative Business Solutions
IBM, Microsoft, Novell/Suse and Sophos Consulting
952-544-1108
http://www.cbsol.com
Blog:http://bingo.cbsol.com
 
Old 03-08-2005, 09:38 PM   #3
jschwartzman
LQ Newbie
 
Registered: Mar 2005
Distribution: opensuse
Posts: 7

Original Poster
Rep: Reputation: 0
I do have WINS support enabled. My Windows versions are XP pro and 2000. I care because I'm trying to understand how address resolution works using dhcp client (or in this case - doesn't work).
 
Old 03-08-2005, 09:48 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
My ISP does not allow static routing.
This refers to the WAN address of the cable router and not the addresses of your computers on the LAN. Inside the LAN, you could use static addresses. You may want to do this anyway for hosts that run certain servers, such as samba or mysql.
 
Old 03-08-2005, 09:58 PM   #5
jjohnston62
Member
 
Registered: Aug 2003
Location: Minnesota, USA
Distribution: RedHat, Suse
Posts: 106

Rep: Reputation: 15
Samba

The samba site, www.samba.org has two books, Samba By Example, and TOSHARG - which basically contains gobs of howto information on samba. Both have information on address resolution regarding windows networks.

If I remember correctly, the begining of the Samba by Example book has information on stepping through some tests to verify that name resolution is working correctly, including verification that your samba config is correct.

Jon Johnston
Creative Business Solutions
IBM, Microsoft, Novell/Suse and Sophos Consulting
952-544-1108
http://www.cbsol.com
Blog:http://bingo.cbsol.com
 
Old 03-08-2005, 10:01 PM   #6
jschwartzman
LQ Newbie
 
Registered: Mar 2005
Distribution: opensuse
Posts: 7

Original Poster
Rep: Reputation: 0
Yes, I realize that I could use static routing, and that may make more sense. To do that would I assign IP addresses outside the range of addresses the router is set to provide via dhcp and then put the names and addresses in hosts? I'd still like to know why dhcp client or WINS isn't resolving hostnames.
 
Old 03-08-2005, 10:30 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If this is a linksys cable router, then it assigns addresses starting with 192.268.1.100 for up to 50 hosts by default. You could assign the static address below this, such as 192.268.1.50 and up.

I don't know the exact details, but I have read that having dynamic address for certain services can cause problems. Plus, if you know the static addresses that you use on your lan, may make it easier to configure your firewalls to exclude hosts outside the range.

This may not be a solution if you have a large network and need to use dhcp to avoid needing to manually assign IP address for 50, or hundreds of hosts.

There are 3 possible DHCP clients that you might be using. One of them is by ISC. They wrote the DHCP server that comes with linux. Here is a howto about using DNS for name resolution, updated by DHCP. Perhaps this may help. http://www.arda.homeunix.net/dnssetup.shtml

I don't know how fully the router's implementation of a dhcp server is, so one option is to turn off the server on the router and operate your own dhcp server. Here is a "network nirvana" article from linux-magazine about setting up your own dhcp server:
http://www.linux-mag.com/2000-04/network nirvana_01.html

Last edited by jschiwal; 03-08-2005 at 11:23 PM.
 
Old 03-08-2005, 10:52 PM   #8
jschwartzman
LQ Newbie
 
Registered: Mar 2005
Distribution: opensuse
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks Jon. I've used the troubleshooting tree in the O'RIELLY book, Using Using Samba. It advises me to ping first by address and then by hostname. My Windows machines are setup to use NetBIOS over TCP/IP.

But Samba seems perfectly happy: it knows the hostnames. It's just ping machine_name or arp -a machine_name that tells me unknown host machine_name.

I just have a workgroup, I'm not using DNS or NIS locally, although I guess my router/dhcp server must also be a name server. (The router certainly knows the hostnames of all of the machines its configured by DHCP.) Should I tell Linux to use to use DNS and provide my router's gateway address as the name server? I'm really confused about how Linux discovers hostnames. Does it use WINS or brodcast or do I have to use DNS or NIS?
 
Old 03-10-2005, 01:02 PM   #9
jschwartzman
LQ Newbie
 
Registered: Mar 2005
Distribution: opensuse
Posts: 7

Original Poster
Rep: Reputation: 0
WINS support

Samba is providing WINS support. I'm not using DNS, NFS, NIS or NIS+. Do I need to be using one of these methods to allow Linux to discover NetBIOS hostnames on a DHCP configured network? Do I need to configure WINS? If so, how?

Thanks for your help!

Last edited by jschwartzman; 03-10-2005 at 01:03 PM.
 
Old 03-10-2005, 05:44 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Do you have the WINS option 'wins support' or 'wins server'. 'wins support = yes' configures samba as a WINS server. 'wins server = a.b.c.d' causes samba to register with a WINS server. These options are mutually exclusive.

According to 9.3.1 NetBIOS over TCP/IP
from the Samba-3 Reference Guide:
Quote:
... in those networks where Sambba is the only SMB server technology, where ever possible nmbd should be configured on one machine as the WINS server. This makes it easy to manage the browsing environment.
This is the order that MS Windows 200x/XP systems attempt to resolve a host name to an IP address:
1. HOSTS file
2. DNS lookup
3. NetBIOS name cache
4. WINS server
5. broadcast name lookup over UDP
6. LMHOSTS file
(page 106 from same book)

If you are using Dynamic Host Control Protocol, then the HOSTS file isn't used ( except for fixed server address )
I don't believe that you are running a DNS server.

---
Trying to google for information about linksys dhcp "name-resolution", i found this link.

http://www.linksysinfo.org/modules.p...wtopic&p=10948

Someone with a WRT54GS linksys wireless cable/dsl router/switch was able to browse only by IP and not by name. I don't remember on the linksys were this setting is, but here is the solution that worked according the the thread:
Quote:
Make sure that "loopback" is DISABLED or you can only browse by IP. For some reason, this is enabled by default when you flash, and it was an annoying troubleshooting step for those of us who have MSFT environments.
I, myself have a lot to learn about Samba. If the main reason for posting is to learn, I would highly recommend "The Official Samba-3: HOWTO and Reference Guide"

---

Make sure that you don't have the IPX protocol installed on any of the windows clients. This will cause Samba to lose all LMB elections. This will cause browse list operations on TCP/IP-only machines to fail (Default Windows XP).

----

Do you use the 'workgroup' option in smb.conf to control what workgroup Samba becomes a part of?

----

One last thought. If your samba server functions as a WINS server, does the linksys DHCP server provide information on the WINS ip address. I believe that you want the samba server to have a static address if it functions as a WINS server. This information should be provided by the linksys dhcp server to the dhcp clients, so the address should be fixed. If the address isn't fixed and could change, this may result in linksys not reporting the address because it may become stale. I'm guessing here, I admit, but it seems to make some sense.

Last edited by jschiwal; 03-10-2005 at 06:25 PM.
 
Old 03-14-2005, 03:29 PM   #11
jschwartzman
LQ Newbie
 
Registered: Mar 2005
Distribution: opensuse
Posts: 7

Original Poster
Rep: Reputation: 0
Samba uses WINS support, thus Samba is the WINS server. My router/DHCP server is a Belkin model which provides wired (4-port switch) and wireless 802.11G connections. I couldn't find a loopback option for the router.

Comcast has told me that I must configure my computers via DHCP. One respondent said:

Quote:
This refers to the WAN address of the cable router and not the addresses of your computers on the LAN. Inside the LAN, you could use static addresses. You may want to do this anyway for hosts that run certain servers, such as samba or mysql.
So I tried assigning my computers static IP addresses outside the range of DHCP addresses provided by my router, but then they couldn't discover their internet connections. If you provide a static IP address you must also provide a static DNS address and that's what Comcast says I can't do.

The best I can do for now seems to be setting the HOSTS file with the IP addresses assigned to my computers by DHCP, since these will rarely change. This allows Linux to ping the Windows machines (XP pro and 2000) by their NetBIOS hostnames. I just wish I could find a more elegant way to configure my workgroup.

Thanks for all your help!
 
  


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 ping the server itself by ip or hostname h_h_q Linux - General 1 01-12-2005 01:24 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
Unable to ping hostname? robertmarkbram Linux - General 2 11-28-2003 12:06 AM
Can ping by IP but not by hostname gillesdutertre Linux - Networking 8 09-01-2003 07:59 AM
can ping by IP but not by hostname al contado Linux - Networking 6 03-16-2003 03:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration