473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

GetHostbyAddress problem --?

I have an application that does a reverse lookup using
System.net.dns.gethostbyaddress, however I am encountering some problems.

If the application resolves the address of another machine it works fine,
but when resolving its own address, I get incorrect results.

SERVERA has 2 IP addresses (IPA1, IPA2). Each IP address has one DNS entry
(HOSTA1, HOSTA2)
SERVERB has 2 IP addresses (IPB1, IPB2). Each IP address has one DNS entry
(HOSTB1, HOSTB2)

If my application runs on SERVERA:

IPB1 resolves to HOSTB1
IPB2 resolves to HOSTB2

but...

IPA1 resolves to HOSTA1
IPA2 resolves to HOSTA1

If my application runs on SERVERB:

IPA1 resolves to HOSTA1
IPA2 resolves to HOSTA2

but...

IPB1 resolves to HOSTB1
IPB2 resolves to HOSTB1

Am I crazy?
Nov 21 '05 #1
3 1660
can u do one ip at a times until ip resolved.
Jerome Lavalley, MCSE wrote:
I have an application that does a reverse lookup using
System.net.dns.gethostbyaddress, however I am encountering some problems.

If the application resolves the address of another machine it works fine,
but when resolving its own address, I get incorrect results.

SERVERA has 2 IP addresses (IPA1, IPA2). Each IP address has one DNS entry
(HOSTA1, HOSTA2)
SERVERB has 2 IP addresses (IPB1, IPB2). Each IP address has one DNS entry
(HOSTB1, HOSTB2)

If my application runs on SERVERA:

IPB1 resolves to HOSTB1
IPB2 resolves to HOSTB2

but...

IPA1 resolves to HOSTA1
IPA2 resolves to HOSTA1

If my application runs on SERVERB:

IPA1 resolves to HOSTA1
IPA2 resolves to HOSTA2

but...

IPB1 resolves to HOSTB1
IPB2 resolves to HOSTB1

Am I crazy?


Nov 21 '05 #2
No. I am only given one IP address and want the DNS entry that corresponds
with it.
Nov 21 '05 #3
Is no one else using this method?

I thought this method was using DNS, but clearly its not. Its doing
something different for the local machine. Any clue how I can force it to
use DNS??
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ruggierorizzi | last post by:
Hi everyone, i would like to know if there is a difference between gethostbyaddress method and $_SERVER. furthermore i hve a little problem using ip address resolution. Some ip address...
1
by: Rushikesh Joshi | last post by:
Hi Friends I am having some query. On a server two site hosted 1) magnamags.com 2) stardustindia.com Now when I am resolving the IP address for this both sites. I am getting...
1
by: Amy L. | last post by:
When I make the following call: IPHostEntry hostInfo = Dns.GetHostByAddress( hostIPAddress ) ; If the PTR (i.e. the IP address to name resolution) does not exist my program will start making...
1
by: huzz | last post by:
I wrote a method which takes an ip address and returns hostname as shown below. It works fine.. only problem i have is when the passed ip address is not found in the database the method throws this...
3
by: RZ | last post by:
Hi Folks, I wrote an app to scan our Packet Filter logs for certain IPs. It uses GetHostByAddress(). I used multi-threading to get around the 2 second hang. The remaining problem is that...
5
by: Sven | last post by:
Hi! I have a problem with System.Net.Dns.GetHostByAddress(ls_Request.UserHostAddress()).HostName Usually the call GetHostByAddress returns the correct hostname of the client, but sometimes...
1
by: Jed | last post by:
I have a class for logging information about user activity on a web site, but it suddenly became really slow. I was wondering what factors may have caused the slow down. Initially, I used the...
2
by: Dave | last post by:
I don't suppose anyone will be able to help with this, it's most odd. I use IPHostEntry hostInfo = GetHostByAddress(ipAddress) to resolve an IP address to a name (in this case it is actually the...
3
by: Steve Richter | last post by:
I am using Dns.GetHostByAddress and Dns.Resolve to successfully resolve and IP address to an IPEndPoint. IPEndPoint ep = null; IPAddress ipAddr = IPAddress.Parse(m_sRemoteHost); ep = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.