You are here

Z - (Deprecated) Finding Your Server's IP Address

DEPRECATED: Starting in May 2018, all new subscriptions default to HTTP Basic Authentication rather than IP-based authentication. This documentation only applies to older subscriptions which have not been converted to using HTTP Basic Authentication. If you want to upgrade your legacy subscription, please see the following support document: Switch your subscription from IP to HTTP Basic Authentication.

In order for our search service to handle your data securely, we need to know the IP address of your website's server. This will let us only accept search information from your server, and it also ensures that only your website will be able to retrieve information from the search server.

The easiest way to do this is to use a simple PHP script on your server which will use dyndns.org's IP checking service. On your web server, somewhere publicly accessible (like www.example.com/files/), create a new file, and name it "getip.php". Inside the file, add the following:


<?php
$url 
"http://checkip.dyndns.org/";
echo 
file_get_contents($url);
?>

Now, go to that URL (in our example: www.example.com/files/getip.php), and copy out the IP address.

If the PHP code above gives you errors, try the following instead (some PHP installations restrict the use of file_get_contents() for security purposes):


<?php
$url 
"http://checkip.dyndns.org/";
$ch curl_init();
curl_setopt ($chCURLOPT_URL$url);
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
curl_setopt ($chCURLOPT_CONNECTTIMEOUT5);
$file_contents curl_exec($ch);
curl_close($ch);
echo 
$file_contents;
?>

Other Methods of Finding Your Server's IP

If your server is running Linux, and you have shell (command line) access, you can run one of the commands in this guide: Linux command: What is my IP? (Public IP address). This method uses wget, curl or lynx to check your machine's public IP address using http://checkip.dyndns.org/.

If your server is running Windows, OS X, or a version of Linux with which you can log into a graphical user interface, just visit http://checkip.dyndns.org/, and copy the resulting IP address.

What if my server has a dynamic IP address?

Unfortunately, we must have an IP address through which we can communicate with your server. Dynamic IP addresses and hostnames are not able to be used to allow search securely, so we do not support them.