views:

52

answers:

2

I developed a client/server simulation application. I deployed client and server on two different Windows XP machines. Somehow, the client is not able to send requests to the server.

I tried below options:

1. Pinged server machine successfully from client using ipaddress.
2. Pinged client machine successfully  from server using ipaddress.
3. Checked netstat command line tool from both machines. server is in LISTENING mode and client is in SYS_SENT mode. But the foreign address it is using to send is host name not the ip address.
4. Pinged server machine unsuccessfully using host name from client.
5. Pinged client machine successfully using host name from server.

I feel the problem is when the client is trying to connect to the server using the host name.

Could you please let me know how to force an applicaiton to use ip address instead of host name? Is there anyway other map to map the host name to an ip address?

A: 

This is hard to answer without more detail about the network architecture. Some things to investigate are:

  • Is it possible that client and/or server is behind a NAT device, a firewall, or similar?
  • Is any of the IP addresses involved a "local" address, like 192.168.x.y or 10.x.y.z?
  • What are the host names, are they "real" DNS:able names or something more local and/or Windows-specific?
  • How does the client look up the server? There must be a place in code or config data that holds the host name, simply try using the IP there instead if you want to avoid the lookup.
unwind
Thanks for your reply. IP addresses are local, they start with 192.168.x.y. DNS names are more local to the machine. I am giving IP address to the application, but somehow it is using host name while sending data to the server(identified using netstat foreign address).
Mahesh
A: 

Go to your client machine and type in:

nslookup server.company.com

substituting the real host name of your server for server.company.co, of course.

That should tell you which DNS server your client is using (if any) and what it thinks the problem is with the name.

To force an application to use an IP address, generally you just configure it to use the IP address instead of a host name. If the host name is hard-coded, or the application insists on using a host name in preference to an IP address (as one of your other comments seems to indicate), then you're probably out of luck there.

However, you can change the way that most machine resolve the host names, such as with /etc/resolv.conf and /etc/hosts on UNIXy systems and a local hosts file on Windows-y systems.

paxdiablo
I tried nslookup on both client and server. client: -----------------nslookup client-pcServer: ns.murphx.netAddress: 62.69.62.6** ns.murphx.net can't find acf-pc: Non-existent domain.same response when I did nslookup server-pc.Server:---------nslookup client-pc*** Default servers are not available.Server: unknownAddress: 127.0.0.1nslookup server-pc*** Default servers are not available.Server: unknownAddress: 127.0.0.1DNS request timed out. timeout was 2 seconds. ***Request to unknown timed-out.Same response when I did nslookup server-pc.
Mahesh
Your server appears to be using itself as a DNS server (and yet is not running a DNS service by the looks of it). It _may_ have the client details in its local hosts file. Your client, on the other hand, is configured to use ns.murphx.net as a DNS server but that server doesn't know about acf-pc. You need to sort out where your DNS servers are supposed to be, configure the machines to use them and make sure all your machines are registered in that DNS. Alternatively, for testing, folllow that link I gave on how to set up local DNS translations so that a DNS server is not needed.
paxdiablo