LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-29-2007, 01:32 PM   #1
starmonche
Member
 
Registered: Jan 2007
Location: Overland Park
Distribution: Centos6
Posts: 60

Rep: Reputation: 15
pinging smb server by name returns 127.0.0.1


in xp, pinging my samba server by its ip address works okay but when i ping it by name i get 127.0.0.1

also in xp, pinging other xp boxes by name returns a "host not found" error (pinging by ip works okay)

i've never been able to ping xp machines by name from linux but that's not really an issue since that box just serves files.

might this be an smb.conf issue?

smb.conf:

[global]
workgroup = DECEPTICONS
security = share
remote announce = 172.28.201.255/DECEPTICONS
netbios name = CYBERTRON

hosts allow = 172.28.201. 192.168.36.
log file = /var/log/samba.%m
max log size = 50
TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
socket options = TCP_NODELAY
172.28.201.255/24

load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes

[mtv]
comment = mtv
path = /mnt/250g/mvids
valid users = nobody
browseable = yes
writeable = yes
public = yes

[music]
comment = music
path = /mnt/250g/music
valid users = nobody
browseable = yes
writeable = yes
public = yes

Last edited by starmonche; 07-29-2007 at 01:51 PM.
 
Old 07-29-2007, 02:45 PM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Are you trying to ping the samba server from another machine? If you are, then it sounds like the hostname of the samba server is localhost.localdomain. You will need to give it a real name. Localhost is the "myself" hostname. If another host pings localhost, they will ping themselves instead of the server.

If you are trying to ping the server from itself, then pinging 127.0.0.1 or 127.0.0.2 is normal.
 
Old 07-29-2007, 03:12 PM   #3
starmonche
Member
 
Registered: Jan 2007
Location: Overland Park
Distribution: Centos6
Posts: 60

Original Poster
Rep: Reputation: 15
yup, i'm trying to ping it from another pc (4 other ones actually)

the machine in question is my dhcp server for my network and i just discovered that if i manually assign network settings on any pc (rather than getting them via dhcp) then i can ping the server and other windows pcs just fine.

the manual and automatic settings are exactly the same as far as i can tell. does that make sense?

the hosts file on my linux pc has an address for cybertron and cybertron.starmizzle.com

Last edited by starmonche; 07-29-2007 at 03:16 PM.
 
Old 07-29-2007, 04:27 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You may need to enable wins on the samba server and install libnss_wins.so. It may be installed with the samba-client package. Then add "wins" to the "hosts:" line in /etc/nsswitch.conf file:
Code:
hosts:          files dns wins
Enter the samba server's IP address in the wins entry for the dhcp server. ( I use a linksys router. )
There may be a /var/adm/fillup-templates/samba-client-dhcp.conf file that modifies the smb.conf file for other linux computers. You may need to enable it in a /etc/sysconf/ file somewhere. ( This may be distro dependent however )
This may allow you to ping the netbios hostnames.

An alternative is to run a local dns server for name resolution. I only have 2 or 3 hosts up at a time at home and just keep my /etc/hosts current if there are any changes.

If you don't have very many hosts, and you run your own dhcp server, you could configure the server to give the hosts a certain IP address, based on the MAC address. Then you could use an /etc/hosts file and not have to worry about it not being current.

Last edited by jschiwal; 07-29-2007 at 04:28 PM.
 
Old 07-29-2007, 05:06 PM   #5
starmonche
Member
 
Registered: Jan 2007
Location: Overland Park
Distribution: Centos6
Posts: 60

Original Poster
Rep: Reputation: 15
got it working by adding this to dhcpd.conf:
option netbios-name-servers 172.28.201.3

and adding this to smb.conf:
wins support = yes
local master = yes
preferred master = yes
os level = 65
wins proxy = yes

and adding this to nsswitch.conf:
hosts: files dns wins

so now everything on my network can ping everything else by name.

BUT it'd be cool to be able to ping the machines based on the name i assign in dhcpd.conf instead of their names assigned in each os. is there a way to do that without updating the hosts file on every machine? i don't change them often but if i do it'd be nice to change stuff in one MAYBE two places (dhcpd.conf and linux's hosts for example)

thanks for the QUICK feedback
 
Old 07-29-2007, 07:44 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I don't know about your windows hosts, but there is an option to allow dhcp to change the hostname.
As far as I know, the dhcp clients will supply the dhcp server with there hostnames so I don't think assigning hosts centrally would be necessary.

I think this will work better since you are running your own dhcp server rather than using a router's for example.

Make sure that you have a wins entry for the dhcp server. You will want it to supply the wins IP address to all of the clients. This may already be the case. An advantage now is that the hosts won't waste bandwidth constantly broadcasting to each other. They will use the WINS server instead.

Last edited by jschiwal; 07-29-2007 at 07:50 PM.
 
Old 08-10-2007, 05:40 AM   #7
starmonche
Member
 
Registered: Jan 2007
Location: Overland Park
Distribution: Centos6
Posts: 60

Original Poster
Rep: Reputation: 15
i believe the reason i was getting "127.0.0.1" while pinging my linux server from an xp machine was that my zone file had this in the list of static addresses at the bottom:

cybertron IN A 127.0.0.1

(which i wouldn't have noticed unless i'd misconfigured it broadcasting its name to begin with)

so i made a list of my "pet names" for my PCs with their corresponding IPs and added it all to my zone file.

works great for sharing/remoting around the network.

i still have no idea how to have my dhcpd assigned names show up in network neighborhood instead of the hostnames assigned in each OS.
 
  


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
Pinging Fedora Server?? OneManOfBits Linux - Newbie 2 04-12-2007 06:51 PM
Apache Server not responding to 127.0.0.1 khairkhoah Linux - Networking 2 05-11-2006 08:15 AM
DSN: Data format error & relay=[127.0.0.1] [127.0.0.1] calmbomb Linux - Software 0 11-07-2004 03:24 PM
My server has 127.0.0.1 ip instead of one from a remote DHCP server? leefarrant Linux - Newbie 6 11-18-2003 11:57 AM
Creating a SSL connection from smb clients to a smb server scottpioso General 0 11-17-2003 02:33 PM


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

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