Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am migrating from windows to linux, and I am using ubuntu for my development now.

I installed apache and it works great; my problem isIi need to use a fully-qualified domain name to access my local webserver, ie http://www.example.com/ should go to my local apache instance, rather than having to use http://localhost or http://127.0.0.1.

In windows this can be achieved through the host file. But not sure about linux.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Linux has a hosts file too, in /etc/hosts. The format should be both familiar and easy to work out.

share|improve this answer
    
this doesn't work network-wide, though, does it? something like that would be best –  tekknolagi Aug 13 '11 at 5:56
3  
It works only on the local machine. It is the job of a DNS server to make this mapping available to other computers. –  uloBasEI Aug 13 '11 at 6:04
2  
@tekknolagi: It wouldn't necessarily be "best". The question asks for the Linux equivalent of the Windows hosts file. I answered that question. When a question comes up asking "how do I provide name service for a network", I'll answer that one with something different. –  womble Aug 13 '11 at 7:09
    
sorry... and so i upvoted your answer :) –  tekknolagi Aug 13 '11 at 16:32

Your Answer

 
discard

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.