Access to VirtualHosts from the local network
up vote
0
down vote
favorite
I have a Ubuntu Server 18.04 over VirtualBox VM where I've installed Apache and Nginx for some testing. The VirtualServer example.com up and running on the local machine. That VM is configured with 2 network adapters, 1st one configured as Internal Network and 2nd one as NAT in order to have internet connection.
A second VM, Ubuntu 18.04 (Desktop) is configured with Internal Network only. This VM can reach the Ubuntu server via IP but is unable to resolve example.com
I'm wondering if there is a way to make it happen without configuring a DNS server on the Ubuntu Server VM. Any ideas?
networking virtualbox virtual-machine virtual-host
add a comment |
up vote
0
down vote
favorite
I have a Ubuntu Server 18.04 over VirtualBox VM where I've installed Apache and Nginx for some testing. The VirtualServer example.com up and running on the local machine. That VM is configured with 2 network adapters, 1st one configured as Internal Network and 2nd one as NAT in order to have internet connection.
A second VM, Ubuntu 18.04 (Desktop) is configured with Internal Network only. This VM can reach the Ubuntu server via IP but is unable to resolve example.com
I'm wondering if there is a way to make it happen without configuring a DNS server on the Ubuntu Server VM. Any ideas?
networking virtualbox virtual-machine virtual-host
Hi AtomicNation! You can write an entry in the /etc/hosts file with the formatIP example.com
. Regards
– Jorge Valentini
Nov 21 at 20:31
1
@AtomicNation Welcome on SuperUser... You can edit your post adding the IP of the internal network interface in order to (hope to) receive a (more) detailed answer useful for other people too... do not forget to upvote and accept the answer(s) you may found useful...
– Hastur
Nov 21 at 21:33
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Ubuntu Server 18.04 over VirtualBox VM where I've installed Apache and Nginx for some testing. The VirtualServer example.com up and running on the local machine. That VM is configured with 2 network adapters, 1st one configured as Internal Network and 2nd one as NAT in order to have internet connection.
A second VM, Ubuntu 18.04 (Desktop) is configured with Internal Network only. This VM can reach the Ubuntu server via IP but is unable to resolve example.com
I'm wondering if there is a way to make it happen without configuring a DNS server on the Ubuntu Server VM. Any ideas?
networking virtualbox virtual-machine virtual-host
I have a Ubuntu Server 18.04 over VirtualBox VM where I've installed Apache and Nginx for some testing. The VirtualServer example.com up and running on the local machine. That VM is configured with 2 network adapters, 1st one configured as Internal Network and 2nd one as NAT in order to have internet connection.
A second VM, Ubuntu 18.04 (Desktop) is configured with Internal Network only. This VM can reach the Ubuntu server via IP but is unable to resolve example.com
I'm wondering if there is a way to make it happen without configuring a DNS server on the Ubuntu Server VM. Any ideas?
networking virtualbox virtual-machine virtual-host
networking virtualbox virtual-machine virtual-host
asked Nov 21 at 19:05
AtomicNation
31
31
Hi AtomicNation! You can write an entry in the /etc/hosts file with the formatIP example.com
. Regards
– Jorge Valentini
Nov 21 at 20:31
1
@AtomicNation Welcome on SuperUser... You can edit your post adding the IP of the internal network interface in order to (hope to) receive a (more) detailed answer useful for other people too... do not forget to upvote and accept the answer(s) you may found useful...
– Hastur
Nov 21 at 21:33
add a comment |
Hi AtomicNation! You can write an entry in the /etc/hosts file with the formatIP example.com
. Regards
– Jorge Valentini
Nov 21 at 20:31
1
@AtomicNation Welcome on SuperUser... You can edit your post adding the IP of the internal network interface in order to (hope to) receive a (more) detailed answer useful for other people too... do not forget to upvote and accept the answer(s) you may found useful...
– Hastur
Nov 21 at 21:33
Hi AtomicNation! You can write an entry in the /etc/hosts file with the format
IP example.com
. Regards– Jorge Valentini
Nov 21 at 20:31
Hi AtomicNation! You can write an entry in the /etc/hosts file with the format
IP example.com
. Regards– Jorge Valentini
Nov 21 at 20:31
1
1
@AtomicNation Welcome on SuperUser... You can edit your post adding the IP of the internal network interface in order to (hope to) receive a (more) detailed answer useful for other people too... do not forget to upvote and accept the answer(s) you may found useful...
– Hastur
Nov 21 at 21:33
@AtomicNation Welcome on SuperUser... You can edit your post adding the IP of the internal network interface in order to (hope to) receive a (more) detailed answer useful for other people too... do not forget to upvote and accept the answer(s) you may found useful...
– Hastur
Nov 21 at 21:33
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Let's suppose the IP of the web server is 10.0.0.1.
Write a line in the /etc/hosts
file of the second VM (The client):
10.0.0.1 example.com
And it will be able to resolve example.com as 10.0.0.1
Note: It can be a tab, a space of multiple spaces to separate the two arguments
Note 2: This is for testing purposes only, not for production environments
Note 3: As @Hastur states, for the specific case of example.com, this should not be of any inconvenience as it is reserved, but if it actually is another domain, use only for testing purposes!
1
Hi Jorge, neat answer. Ps>example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.
– Hastur
Nov 21 at 21:00
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Well I seem to remember that instead ofexample.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life...;)
ps> name related to the disappoint often felt when you test something...
– Hastur
Nov 21 at 21:28
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
1
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reservedexample.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...
– Hastur
Nov 21 at 21:44
|
show 2 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Let's suppose the IP of the web server is 10.0.0.1.
Write a line in the /etc/hosts
file of the second VM (The client):
10.0.0.1 example.com
And it will be able to resolve example.com as 10.0.0.1
Note: It can be a tab, a space of multiple spaces to separate the two arguments
Note 2: This is for testing purposes only, not for production environments
Note 3: As @Hastur states, for the specific case of example.com, this should not be of any inconvenience as it is reserved, but if it actually is another domain, use only for testing purposes!
1
Hi Jorge, neat answer. Ps>example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.
– Hastur
Nov 21 at 21:00
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Well I seem to remember that instead ofexample.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life...;)
ps> name related to the disappoint often felt when you test something...
– Hastur
Nov 21 at 21:28
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
1
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reservedexample.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...
– Hastur
Nov 21 at 21:44
|
show 2 more comments
up vote
1
down vote
accepted
Let's suppose the IP of the web server is 10.0.0.1.
Write a line in the /etc/hosts
file of the second VM (The client):
10.0.0.1 example.com
And it will be able to resolve example.com as 10.0.0.1
Note: It can be a tab, a space of multiple spaces to separate the two arguments
Note 2: This is for testing purposes only, not for production environments
Note 3: As @Hastur states, for the specific case of example.com, this should not be of any inconvenience as it is reserved, but if it actually is another domain, use only for testing purposes!
1
Hi Jorge, neat answer. Ps>example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.
– Hastur
Nov 21 at 21:00
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Well I seem to remember that instead ofexample.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life...;)
ps> name related to the disappoint often felt when you test something...
– Hastur
Nov 21 at 21:28
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
1
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reservedexample.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...
– Hastur
Nov 21 at 21:44
|
show 2 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Let's suppose the IP of the web server is 10.0.0.1.
Write a line in the /etc/hosts
file of the second VM (The client):
10.0.0.1 example.com
And it will be able to resolve example.com as 10.0.0.1
Note: It can be a tab, a space of multiple spaces to separate the two arguments
Note 2: This is for testing purposes only, not for production environments
Note 3: As @Hastur states, for the specific case of example.com, this should not be of any inconvenience as it is reserved, but if it actually is another domain, use only for testing purposes!
Let's suppose the IP of the web server is 10.0.0.1.
Write a line in the /etc/hosts
file of the second VM (The client):
10.0.0.1 example.com
And it will be able to resolve example.com as 10.0.0.1
Note: It can be a tab, a space of multiple spaces to separate the two arguments
Note 2: This is for testing purposes only, not for production environments
Note 3: As @Hastur states, for the specific case of example.com, this should not be of any inconvenience as it is reserved, but if it actually is another domain, use only for testing purposes!
edited Nov 21 at 21:11
answered Nov 21 at 20:33
Jorge Valentini
1929
1929
1
Hi Jorge, neat answer. Ps>example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.
– Hastur
Nov 21 at 21:00
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Well I seem to remember that instead ofexample.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life...;)
ps> name related to the disappoint often felt when you test something...
– Hastur
Nov 21 at 21:28
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
1
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reservedexample.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...
– Hastur
Nov 21 at 21:44
|
show 2 more comments
1
Hi Jorge, neat answer. Ps>example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.
– Hastur
Nov 21 at 21:00
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Well I seem to remember that instead ofexample.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life...;)
ps> name related to the disappoint often felt when you test something...
– Hastur
Nov 21 at 21:28
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
1
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reservedexample.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...
– Hastur
Nov 21 at 21:44
1
1
Hi Jorge, neat answer. Ps>
example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.– Hastur
Nov 21 at 21:00
Hi Jorge, neat answer. Ps>
example.com
is one of the managed Reserved Domains... so even in a production environment it shouldn't incur in serious problems... but it is always better to say.– Hastur
Nov 21 at 21:00
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Applause! hahaha, Thanks for your comment @Hastur, I just assumed that example.com was actually an example for him!! I figured that it wasn't actually example.com. But I didn't know it was reserved for this, so thanks for enlightening me!
– Jorge Valentini
Nov 21 at 21:07
Well I seem to remember that instead of
example.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life... ;)
ps> name related to the disappoint often felt when you test something...– Hastur
Nov 21 at 21:28
Well I seem to remember that instead of
example.com
in the beginning it was proposed another one... but actually someone had already registered it in the real life... ;)
ps> name related to the disappoint often felt when you test something...– Hastur
Nov 21 at 21:28
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
Amazing story!!
– Jorge Valentini
Nov 21 at 21:33
1
1
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reserved
example.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...– Hastur
Nov 21 at 21:44
Unfortunately It is an urban myth... Just check the issue date of the RFC 2606 (where it is reserved
example.com
) --June 1999-- and the one of the registration of the other name on whois --Registered On: 1999-07-08-- but it was funny to listen...– Hastur
Nov 21 at 21:44
|
show 2 more comments
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377387%2faccess-to-virtualhosts-from-the-local-network%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hi AtomicNation! You can write an entry in the /etc/hosts file with the format
IP example.com
. Regards– Jorge Valentini
Nov 21 at 20:31
1
@AtomicNation Welcome on SuperUser... You can edit your post adding the IP of the internal network interface in order to (hope to) receive a (more) detailed answer useful for other people too... do not forget to upvote and accept the answer(s) you may found useful...
– Hastur
Nov 21 at 21:33