Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

What I need is to configure a Linux machine, so that when user of that machine goes to he/she is redirected to, say,

What is the best way to achieve it?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Linux has the same host file. Just edit:


Depending on your system a command like this will open up that file:

$ sudo nano /etc/hosts

Just put lines like this in there and save:


For example: wwwanother
share|improve this answer
How to achieve the reverse? – Acute Sep 2 '13 at 16:53
That file will convert or wwwanother to which is what you are looking for. – Drav Sloan Sep 2 '13 at 17:42
should I restart after editing the hosts file? – Acute Sep 2 '13 at 21:22
You should flush your dns cache… and restart your browser. But reboot is another option. – fclad Sep 3 '13 at 4:46
@fclad installing the nscd made the things work. – Acute Sep 3 '13 at 7:37

If you want to override entries on more than one machine, then you could set up a DNS proxy such as Unbound or DNSmasq.

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.