Maybe manually add entries to the /etc/hosts file on each VM. Like :
192.168.1.55 website.dev
192.168.1.56 website2.dev
Might also work if you put those entries on the "real" servers hosts file - depends how your VM server is resolving addresses.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Heyo,
This might be a silly question, but I'm posting here to see if anybody has run into this issue before. I have 2 applications running on my local VM. I'm trying to use cURL to make a request from one server to the other... but it seems like no matter what I do it can't resolve the hostname.
I've used guzzle, plain curl, and tried some other options and they all just throw an error saying can't resolve hostname to my virtual host.
I CAN however, curl to any live public domain. For example I can hit the address for the production server of my application.
For example let's say I have my local environment server #1 at website.dev and website2.dev. I also have a production version of site #2 at myrealwebsite.com . I can curl from website.dev to myrealwebsite.com, but I can't hit website2.dev using cURL.
I know the local development server that I can't reach via curl is working. I can hit the same endpoint via POSTMAN, or through my browser etc. But it might as well not be there when it comes to trying to hit it with curl.
Thanks if anybody has any ideas. For now I have a workaround for my testing of putting up a test server on a public URL to represent my server #2.
-Isaac
Double check the /etc/hosts file inside your VM. That command usually tries and find things there first (although nsswitch.conf can change things around).
Please or to participate in this conversation.