This might be a very basic question.
I have bought space from a web supplier. They have given me a url which is numbers like http://107.170.253.5/
. I wondered how can I change it to an alphabet link such as myfirstwebsite.com.au
.
Appreciate any suggestion...
Make use of gethostbyaddr()
in PHP:
//Get the Internet host name corresponding to a given IP address
<?php
$hostname = gethostbyaddr('107.170.253.5');
echo $hostname; //<---- To print the hostname
Edit:
This is not working. it is giving me a link to my wireless!
That actually works, you have not mapped your domain with the IP address. See the below example and it works perfectly:
<?php
echo $ip = gethostbyname('www.stackoverflow.com'); //"prints" 198.252.206.140
echo gethostbyaddr($ip); //"prints" stackoverflow.com