473,698 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetHostbyAddres s problem --?

I have an application that does a reverse lookup using
System.net.dns. gethostbyaddres s, 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 1677
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 .gethostbyaddre ss, 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
5214
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 are resolved other not. Why?
1
369
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 202.71.136.211 (using GetHostByName).
1
471
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 Netbios calls (Name query to the remote host). The netbios lookup is very undesired. Is there a way to not perform the netbios query if the PTR record does not exist?
1
2605
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 error message : The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for How can i prevent this error message and instead return "-" ? Many Thanks.
3
4026
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 GetHostByAddress() also attempts to resolve the machine name via NetBIOS. After running the application, the blocked packets to port 137 from our own IP are added
5
2255
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 I get a hostname like _CERDR1342B88E. Why? The clients are running under Windows CE.NET 4.1...
1
2629
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 following code: ul.HostName = context.Request.UserHostName; Since the UserHostName is not always resolved, I opted for the following more effective code: IPAddress hostIPAddress = IPAddress.Parse(context.Request.UserHostAddress);
2
1377
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 local computer, if that's relevant). The call is made on several occasions as the program runs, the first two times it works fine, then, for no reason, instead of the name it returns the IP address in hostInfo.HostName. This program has been...
3
16599
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 IPEndPoint(Dns.GetHostByAddress(ipAddr).AddressList, m_iRemotePort); // ep = new IPEndPoint(Dns.GetHostEntry(ipAddr).AddressList, m_iRemotePort); // ep = new IPEndPoint(Dns.Resolve(m_sRemoteHost).AddressList,
0
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.