LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   host file two domain name 1 ip address (https://www.linuxquestions.org/questions/linux-general-1/host-file-two-domain-name-1-ip-address-4175437002/)

musthavelu 11-13-2012 05:05 PM

host file two domain name 1 ip address
 
Hello, I need to map two domain names to one IP address. Is the host file below correct? Are there any other changes I need to make to the resolve file?

127.0.0.1 localhost.localdomain localhost
1.2.3.4 mysite1.com mysite2.com
::1 localhost6.localdomain6 localhost6

custangro 11-13-2012 06:25 PM

That should work (on that one host only though)

-C

musthavelu 11-13-2012 10:09 PM

Okay thank you I will try it tomorrow.

Wim Sturkenboom 11-13-2012 11:14 PM

Although it might work, it's not quite what you're after.
Code:

127.0.0.1 localhost.localdomain localhost
1.2.3.4 mysite1.com
1.2.3.4 mysite2.com
::1 localhost6.localdomain6 localhost6

This needs to be setup on the machines that will connect to the server, not necessarily on the server itself.

musthavelu 11-13-2012 11:52 PM

I will give that a try Wim, thank you.


All times are GMT -5. The time now is 03:34 PM.