Get Domain Name From Ip Address In C
Get machine name from ip address in c you can use this c function to convert ip address into hostname in c private static string getmachinenamefromipaddress string ipadress string.
Get domain name from ip address in c. The dns domain name service class is present in the system net namespace that has methods to retrieve ip addresses host names and so on. It s much easier for users to deal with the hostname than having to type in an ip address. In general when we need to find an ip address of a machine we run the ipconfig command in a command prompt. Thanks in advance thursday march 17 2011 8 33 pm answers text html 3 23 2011 3 23 30 pm adavesh 4 4 sign in new.
Getiing ip address host name domain name through c code. Normally we use ping command to check whether a machine is online or not. We can get machine name from ip address by giving extra parameter a with ping command. A frequent task when designing applications that work with tcp ip and the internet is to lookup an ip address from a hostname.
We can also find it using c using the dns class. Asp net domain name to ip resolution get ip address given host name here s the 3 line code to get ip from host name dim ipaddress as system net ipaddress ipaddress system net dns gethostaddresses smtp mail. We can resolve hostname from ip address using ping command in cmd command prompt and we can also get ip address of a specified computer using ping command. Resolve hostname from ip address in cmd.