in reply to To know the existence of an ip address

Define "present" and "available". Ping is usually used. (I'm sure someone will explain the caveats...)

when I give unavailable ip address, it is returning the same IP.

While a domain ceases to exist when it's no longer registered, 1.2.3.4 is a perfectly good name for IP address 1.2.3.4 whether 1.2.3.4 is currently "available" or not. An IP address doesn't cease to exist when it's not "available".

  • Comment on Re: To know the existence of an ip address

Replies are listed 'Best First'.
Re^2: To know the existence of an ip address
by JSchmitz (Canon) on Sep 14, 2009 at 13:14 UTC
    Sounds like a job for nmap then just grep for the host/ip - I know that's a nasty way to go about it though -sL (list scan) Also check out the Nmap::Parser module here http://search.cpan.org/~apersaud/Nmap-Parser/

    You may be getting a call from the security team at your company after running lol