A
A
Andrey Smirnov2014-03-16 22:47:10
Apache HTTP Server
Andrey Smirnov, 2014-03-16 22:47:10

How to access domains on a virtual machine without changing the hosts file in Windows?

Good mood everyone!
There was a need to organize a working environment for web development on a virtual ubuntu (server, version 12) in VirtualBox under Windows 7. Since the virtual server has its own name (let's say local), it was decided to name all domains inside it accordingly (project.local, test.local, username.project.local, etc.).
Actually, against the background of this task, a problem arose - how can you make it so that when you open domains like test.local or, even worse, random-subdomain.test.local, from Windows, the corresponding virtual machine sites open, but at the same time not to was it necessary to make changes to / windows / system32 / drivers / etc / hosts for each new domain on Windows?
The last part of the question is also due to the fact that subdomains can be different, including virtual (dynamic), and hosts in Windows does not support wildcard.
There is a suspicion that for this it will be necessary to raise bind9 on the virtual machine and in Windows, as a dns server, register the address of the virtual machine, but I would like to know alternative ways.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Salavat Sharapov, 2014-03-17
@Melorian

But it seems that bind9 is the most correct option, it just might come in handy later =). You will need to create a local zone. and in the config already * A "webserver iP". And it will go to local, and there it will already check with the alias of the web server or application, for example, to django (django-hosts).

S
silentvick, 2014-03-16
@silentvick

Acrylic DNS Proxy allows you to use wildcards in hosts. For example, addresses like "127.0.0.1 *.loc".

K
Konstantin Kozhin, 2014-03-17
@kkzhn

Configuring bind9 and specifying the IP address of the virtual machine with it as a second DNS in the Windows settings of the machines would be the most convenient option, in my opinion.

D
Dmitry, 2015-07-07
@psycat

I will not say that it is bad, but the scope is not large and it is not very popular.

Are you seriously? "Not a big area of ​​application and it's not popular." Just the opposite. Python is not limited to the web. It's funny to read about popularity.
Case in point: Learn Python. Easy to learn, instills good (format code, for example). If you don't like Py, learn something else.

D
Denis Ineshin, 2015-07-07
@IonDen

Everything is useless on a tablet, in order to learn something, you need to program it right there. Just read - time is wasted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question