0

In my previous question, DNS simulation for testing purposes?, I'd asked about simulating DNS.

Is there a way to simulate an IP address within Windows for the virtual hosts in my previous question?

The host in question is:

<VirtualHost 12.345.678>
          NameVirtualHost mywebsitedomain1.co.uk
ServerName  mywebsitedomain1.co.uk
          ServerAlias   www.mywebsitedomain1.co.uk
DocumentRoot /www/vhosts/mywebsitedomain1.co.uk
ErrorLog /www/Apache22/logs/error.log

<Directory "/www/vhosts/mywebsitedomain1.co.uk">
    Options All
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

I added the IP address of a website that I don't use frequently, in this case, here is how the virtual host should look:

<VirtualHost 208.88.246.99>
          NameVirtualHost mywebsitedomain1.co.uk
ServerName  mywebsitedomain1.co.uk
          ServerAlias   www.mywebsitedomain1.co.uk
DocumentRoot /www/vhosts/mywebsitedomain1.co.uk
ErrorLog /www/Apache22/logs/error.log

<Directory "/www/vhosts/mywebsitedomain1.co.uk">
    Options All
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

and in HOSTS file (where my other virtual hosts named are listed), it shows as:

208.88.246.99 mywebsitedomain1.co.uk 
127.0.0.1 mywebsitedomain1.co.uk

The first IP is that of a real website (an online radio station - not visiting it much so I don't mind using the IP for this test).

How can I simulate the IP and DNS for testing purposes?

By the way, I'm on Windows Vista, Home Edition, for the record.

1 Answer 1

1

First, 12.345.678 is not a valid IPv4 address.

Second, you really don't need to do this. I know many people who make their living designing web appliations, and this is something that none of them do.

If you want to "override" a hostname, just add this to your hosts file:

127.0.0.1 example.com

Then set up a NameVirtualHost for example.com.

1
  • OK, I understand it now! Thanks for that. As it were, 12.345.678 was simply placeholder material though!
    – azurio4
    Apr 10, 2011 at 19:40

You must log in to answer this question.