Jump to content

Is an Internet IP static or dynamic?

- - - - -

  • Please log in to reply
3 replies to this topic

#1
g-k

g-k

    Newbie

  • Members
  • Pip
  • 2 posts
How can I find an Internet IP address is static or dynamic via C or C++ or a language that something else
? Thank you.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
The most obvious solution that comes to mind would be to look up the host name and match the string "dynamic". or "static", this is more reliable than just guessing otherwise.

Regardless you would need to know C and utilize a network API such as this before you could do that: gethostbyaddr Function (Windows)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
g-k

g-k

    Newbie

  • Members
  • Pip
  • 2 posts
Thanks for your answer, is there different way? Because I suppose IP addresses's host names don't always contain one of "static" or "dynamic" words. I have just searched at http://whatismyipadd...com/ip-hostname, an IP's hostname was not contain one of these words.

#4
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 762 posts
Afaik, unless you are work on the computer itself or you have access to DHCP server that assigns the IP address for the computer's network, you could not get this information. However this is my impression from my experience in networking, I can be wrong since I never actually looked into this sort of issue.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users