Results 1 to 6 of 6

Thread: How to get domain name from IP address

  1. #1
    Join Date
    Dec 2007
    Posts
    93

    How to get domain name from IP address

    Hi,

    I have heard from my friends that we can convert an Ip address to an domain name I am very much keen to do that, i have try to find it over internet and i got some of the components where i can do it but is there can coding which i can use it,then it would be great for me.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,010

    Re: How to get domain name from IP address

    Sure i will provide you the code for that you need to use the following code:-

    Code:
    HostName = System.Net.Dns.GetHostName();
    
    IPAddres = System.Net.Dns.GetHostAddresses(HostName).GetValue(0).ToString();

  3. #3
    Join Date
    Feb 2008
    Posts
    1,856

    Re: How to get domain name from IP address

    You can also try this code too

    Code:
    Set DomainName = objRootDSE.OpenDSObject("WinNT://TESTDOM", "abc", "xyz", ADS_SECURE_AUTHENTICATION)
    
    DomainName.Filter = Array("User")
    For Each usrName In DomainName
    MsgBox usrName.Name
    Next

  4. #4
    Join Date
    Dec 2007
    Posts
    93

    Re: How to get domain name from IP address

    Thanks for replying me can anyone provide me code get domain name from IP address which is in Vb.Net then i would be very greatfull to him.

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to get domain name from IP address

    At last i have got a code in Vb.Net here goes the code

    Code:
    Dim myHost As String = System.Net.Dns.GetHostName
    Dim myIPs As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(myHost)
    Response.Write("Host Name = " & myIPs.HostName & "<br />")
    For Each myIP As System.Net.IPAddress In myIPs.AddressList
      Response.Write("The IP address of host is = " & myIP.ToString)
    Next

  6. #6
    Join Date
    Jul 2012
    Posts
    2

    Re: How to get domain name from IP address

    hi
    you can simply get the domain name from ip at whoisxy, Here you give only the domain name it provide necessary detail for you

Similar Threads

  1. Replies: 1
    Last Post: 09-06-2012, 07:03 PM
  2. IMpact of changing the IP address of a Domain Controller
    By Ian Wilson in forum Active Directory
    Replies: 6
    Last Post: 31-10-2011, 08:33 PM
  3. Replies: 4
    Last Post: 11-08-2010, 09:22 PM
  4. Is there any way to fetch the ip address/Host name of the Domain controller
    By Swati_here_2008 in forum Software Development
    Replies: 4
    Last Post: 20-05-2008, 02:51 PM
  5. How to change the IP address of Main Domain Controller
    By John in forum Windows Server Help
    Replies: 2
    Last Post: 08-05-2007, 04:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •