Saturday, June 8, 2013

PHP Code to find a website URL IP Address

Every server has an IP address on which multiple or single websites are hosted. If you type any domain name on an address bar, this request goes to domain service provider which tells that on which host this website is hosted. The domain name server tells it by nameserver which you or website admin have updated in domain control panel.

                               The request is redirected to the host and the host tells that on which IP this URL is located. Now coming to the point is there any script which can tell which IP hosts this domain.The code is given below.This code takes the input of the website and just converts website to IP address.

gethostbyname('domain.com');