2

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.

womble
  • 95,029
  • 29
  • 173
  • 228
rajarmaesh
  • 23
  • 1
  • 3

1 Answers1

6

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

womble
  • 95,029
  • 29
  • 173
  • 228
  • this doesn't work network-wide, though, does it? something like that would be best – tekknolagi Aug 13 '11 at 05: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 06: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 07:09
  • sorry... and so i upvoted your answer :) – tekknolagi Aug 13 '11 at 16:32