Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# IP LAN
Hi,
 
I want to list all the sub domain names listed on an IP. Using the tools available on the internet (http://www.reverseipcheck.com/index.php?id=1), I am getting correct info. But my program is returning the error given below :
 
SocketException caught!!!Source : SystemMessage : The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for .
 

The code used by me is :
 string IpAddressString = "64.187.125.151";
 
            try
            {
                IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
                IPHostEntry hostInfo = Dns.GetHostByAddress("64.187.125.151");
                // Get the IP address list that resolves to the host names contained in 
                // the Alias property.
                IPAddress[] address = hostInfo.AddressList;
                // Get the alias names of the addresses in the IP address list.
                String[] alias = hostInfo.Aliases;
                Response.Clear();
                Response.Write("Host name : " + hostInfo.HostName);
                Response.Write("\nAliases :");
                for (int index = 0; index < alias.Length; index++)
                {
                    Response.Write(alias[index]);
                }
                Response.Write("\nIP address list : ");
                for (int index = 0; index < address.Length; index++)
                {
                    Response.Write(address[index]);
                }
            }
            catch (SocketException e)
            {
                Response.Write("SocketException caught!!!");
                Response.Write("Source : " + e.Source);
                Response.Write("Message : " + e.Message);
            }
            catch (FormatException e)
            {
                Response.Write("FormatException caught!!!");
                Response.Write("Source : " + e.Source);
                Response.Write("Message : " + e.Message);
            }
            catch (ArgumentNullException e)
            {
                Response.Write("ArgumentNullException caught!!!");
                Response.Write("Source : " + e.Source);
                Response.Write("Message : " + e.Message);
            }
            catch (Exception e)
            {
                Response.Write("Exception caught!!!");
                Response.Write("Source : " + e.Source);
                Response.Write("Message : " + e.Message);
            }
            Console.ReadLine();
 

The ip used above is "64.187.125.151", showing good results when using 'readymade' tools to find subdomains.
 
Any help would be appreciated. Thanks.
Anurag
Posted 31-Aug-10 20:06pm
Edited 26-Oct-10 4:06am
v3
Comments
1803.anu at 3-Sep-10 8:23am
   
No Help till now !!! :( :( :( ... will someone please tell me, if this is possible or not?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 565
1 Maciej Los 319
2 Richard MacCutchan 220
3 BillWoodruff 164
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 26 Oct 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100