IP Address and Autonomous System Number

06
2014-04
  • Shawn Smith

    Is there a way to hide server's IP Address and Autonomous System Number from search?

    For an example, you do not want users to look up the server location or where it is leased from.

  • Answers
  • Jeremy Sturdivant

    Short answer, no. Long answer, sort-of, if you're running a web server only, and are willing to use a third-party service.

    In order to serve its purpose, a server's IP address needs to be available to all clients who need to contact it. This is generally fulfilled using DNS, giving clients the ability to find the server's IP address using only a name. The IP address is absolutely required in order for packets to get across the internet from your clients to your server. Similarly, any clients of the service can't help but expose their IP address to your server, as that's the only way for packets to get back across the internet to them to deliver your server's responses.

    Moving on to ASNs, there's a similar issue. BGP is used on the internet to tell routers where to send internet traffic. If you hid an ASN from the internet in general, traffic to the IP addresses in that ASN would have no way to get to the appropriate router, and would never reach your server.

    There are however, services that provide an external reverse proxy, such as https://www.cloudflare.com/. These services allow you to give out their IP address in your DNS, and in turn pass on traffic to your server, however these services are generally only useful for a web server. If you are running another type of server (such as a server for a video game, or an FTP server for hosting files), these services don't know how to forward that type of traffic.


  • Related Question

    How can I find out my hosting server's outbound IP address?
  • try2josh

    I need to find out my web hosting server's IP address. Its on a shared hosting server and from experience, it's usually not the same as the incoming IP address that you would get by just pinging the domain name. Is there a php script I can run or something to find our the outbound IP address my website is using when connecting to a SMTP server for example?


  • Related Answers
  • Arjan

    You could do a web request from code (PHP or other) and request a URL such as www.whatismyip.com and save it as a file that you open and look at.

    Reading Remote URL HTML Source in PHP shows some examples. If your PHP installation allows for it, then this could be as simple as creating a file with the following, and then point your browser to it:

    <?php
      // See http://www.whatismyip.com/automation for the exact URL
      echo file_get_contents(
        "http://www.whatismyip.com/automation/n09230945.asp");
    ?>
    
  • SgtOJ

    I think you are looking for this...

    <?php echo $_SERVER['SERVER_ADDR']; ?>

  • A Dwarf

    The host server outbound IP address is the one you see when you ping it, regardless of whether the shared host is name or IP based.

    • For name based shared hosts (all websites share the same IP), the user agent will add the hostname to its requests, which will allow the server to determine which website to show.

    • For IP based shared hosts (each website has its own IP), name resolution is straightforward.

    If you are looking instead for the internal IP address used by your server in its network, this information can be accessed by connecting to your server through a secure shell, which most web hosts provide.

  • jedierikb

    I have success when I try

    curl -s ip.appspot.com