Zaphod Beeblebrox
Zaphod Beeblebrox

Reputation: 562

server IP address of my website rather than domain IP

Hi I need to know the IP address of my website to give to my payment gateway. I know I can find an IP address by going to any of the websites which come up on google, but my understanding is that they give the domain's IP address which may be different from the IP address of the server the site is hosted on.

So how to I find out what the IP address of my server is?

Thanks :)

Upvotes: 0

Views: 1184

Answers (4)

libtek
libtek

Reputation: 26

Run this from the command line to get your server's outgoing IP:

wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Upvotes: 1

CodeCaster
CodeCaster

Reputation: 151604

What do you mean by the domain IP? The IP returned from a DNS lookup when querying your domain? This is most likely equal to the IP of your (shared) server, otherwise your website would be unreachable.

An exception to that is when the IP your DNS record represents belongs to a proxy server, which forwards the request to the real server.

You could always get the public IP address of the server by visiting www.whatismyip.com from the server.

Upvotes: 0

Jakub
Jakub

Reputation: 20475

you can also do a quick PHP output of

<?php
phpinfo();
?>

it will contain all the values you need for your host details (just don't leave this file public after you use it).

Upvotes: 0

0b10011
0b10011

Reputation: 18795

The server's IP address can be found with the $_SERVER variable:

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

Upvotes: 0

Related Questions