Is it possible to somehow fetch the hostname where a website/service resides? I've tried looking into headers, and some more info, but from what I've seen it doesn't seem possible!

As an example: test.mysite.com to be the host's name in /etc/hostname

If it turns to be possible, how can I hide it?

The linux distribution that I use is Debian 6.0.


You're question seems to be about whether other people can see your host's name if you are running a publicly visible Web server on it. No, they only see the name you have published in the Domain Name System for your public IP address.


You can change the hostname to whatever you want as long you alter other configuration files along with the change.

As far as I know, there is no direct way of fetching the hostname of the computer unless there is a DNS entry pointing to the IP address with that hostname. However, some servers might have an API method or a procedure call which makes them get and print/send the hostname.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.