Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


How is that we can convert an IP to a domain name address on linux machine.

Suppose i always access my Pc with from the browser

I want to change this to


share|improve this question

migrated from Jan 8 '10 at 9:35

This question came from our site for professional and enthusiast programmers.

This belongs on superuser. But take a look at man hosts – balpha Jan 8 '10 at 6:11

you can add a line like

to /etc/hosts if you want to bind a hostname to an IP. In most default configurations this file is consulted first.

share|improve this answer
Thanks. This is what i was looking for....... – Hulk Jan 8 '10 at 6:38

I'n not sure exactly what you're asking, but if you just want to know how to look up a domain name associated with an IP address, you can use dig -x to do a reverse DNS lookup:

$ dig +short -x

Note that this won't always work, because there may be multiple domain names pointing at a single IP address, and it's not always the case that every IP address has a reverse DNS mapping.

share|improve this answer
Thanks................ – Hulk Jan 8 '10 at 6:18

You should already be able to access that via http://localhost/, which is the standard name for 'this machine'.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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