I have several virtual hosts set up on my PC running WAMP. All the other PCs in the office need to be able to access these too. Traditionally, every time I added a new virtual host to my PC, I need to go to all of the other office PCs and modify their hosts files. This works fine, but it is a pain to go edit all of these files.
Is there an alternative to this? Is there some way of having a centralised hosts file on the network or some other solution?
First your computer IP and port, then the IP of your virtual machine attached to your NATNETWORK and the port. In my case used 192.168. 1.102:8069 for the host and 10.0. 2.7:8069 for the guest.
Save this answer. Yes, it is and always has been possible to have more than one IP address for a hostname. Note that while gethostbyname returns only one mapping (generally the first found in /etc/hosts), in modern Unix you can use getaddrinfo to walk through the entries.
unfortunately, no. There cannot be two files with the same name. But you can concatenate two files into one. if you'll find someone's post helpful, mark it as an answer and rate it please.
Some routers have the ability to map domain records into IP adresses and act like a DNS. But if your router dont support this:
Try Acrylic DNS Proxy. Acrylic is a free and open source local DNS proxy. Follow the installation instructions on the website to set it up. Basicly you will need to install this program only on your main PC that will act like a "DNS proxy". Then you will need to set your other computers primary DNS server to hook with your main pc.
Launch the Acrylic.exe file and click on the Next button. Read and (if you like it) accept the license agreement by clicking on the I Agree button. Choose the installation folder (the default is the Program Files\Acrylic DNS Proxy folder) and click on the Install button.
Do the following steps only on your main PC
Note: After changing the configuration files you must restart the Acrylic DNS Proxy service from the start menu.
In order to use Acrylic you have to tell your computer that the DNS servers to be contacted for name resolution is no more your ISP's but Acrylic. There are ways to do it depending on the version of the OS you are running:
Note: On your other computers you will have to replace the "127.0.0.1" to your main PC network address. For example "192.168.0.2" . And leave the secondary DNS to 8.8.8.8 (Google DNS) so the other computers can browse the internet even when your main PC is not connectable (or turned off). Like this
Make sure everything is properly configured and your main PC is connectable and running. If you have antivirus or firewall programs they will block this DNS proxy so make sure you configure them properly or disable them at first just to test everything is working. Also your main PC local IP address must be static.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With