How to display your hostname on the web?

DavidO84 used Ask the Experts™

I ahve a fixed ip address provided by my ISP and I am using this for my sever running ubuntu 9.10. I have noticed that if I do an iplookup for most ip address i see it's hostname also. For example if i lookup (which is here -->  - i see the hostname is - but when i lookup my ip address i see nothing

From the command line if I do hostname or hostname -f or hostname --fqdn i see my hostanme which i setup when install ubutnu as an open ssh sever and I also added to hosts.

My question is what controls the display of your hostname to the web?

Is it me or my ISP?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

in php you can do it like this to display a hostname on a webpage:
$ip = "";
$host = gethostbyaddr($ip);
print "The host name for $ip is $host.";

in php. is this what you mean




Hi ByteSleuth,

Thanks for the input, but what i mean is, when my ip address is looked up I want it to display the hostname of my server (


if someone pings it with "ping -a" that reads

"Pinging [] with 32 bytes of data:"

and not just

"Pinging with 32 bytes of data:"

The setup is: I have a fixed Ip address provided my ISP, running ubuntu server 9.10 setup as an openssh with apache2 etc.

Hostname configured to be

this is only visible locally and not when someone does and ip lookup for my ip address.
Resolving the ip with a ping or a lookup depends upon how your ISP has registered their IPs on the DNS. There is nothing you can do from your server to change this.


Great thanks for the information.


Just alittle more info in regard to arranging your hostname on the web when reverse dns is looked up, you must contact your ISP that issued teh static ip address and request that they update your ptr record for that ip address. The name for example must have a valid A record forwarded to your static ip address.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial