Laravel Homestead: Can't ping from inside of the VM any .local sites

六月ゝ 毕业季﹏ 提交于 2019-12-24 22:12:33

问题


No idea where's the issue. My other workmate has no issues pinging foo.local from the host Mac as well as from inside of the VM.

My Homestead.yaml is simple:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/code

sites:
    - map: vppaportal.local
      to: /home/vagrant/code/vppa-portal/public
    - map: iosportal.local
      to: /home/vagrant/code/ios-portal/public
    - map: ascent.local
      to: /home/vagrant/code/ascent/public
    - map: peem.local
      to: /home/vagrant/code/peem-v2/public

databases:
    - homestead

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# zray:
#  If you've already freely registered Z-Ray, you can place the token here.
#     - email: foo@bar.com
#       token: foo
#  Don't forget to ensure that you have 'zray: "true"' for your site.

So when my Homestead is running then on my mac I can ping iosportal.local and it works, but when I ssh into the machine and do ping iosportal.local I get:

vagrant@homestead:~/code$ ping iosportal.local
ping: iosportal.local: Temporary failure in name resolution

回答1:


I solved this by opening /etc/hosts inside the Homestead and adding:

127.0.1.1 iosportal.local

The point is that none of my workmates had to do this hence I consider this as a temporary workaround. If someone will come up with better solution I'm happy to upvote and change accepted answer.



来源:https://stackoverflow.com/questions/57157729/laravel-homestead-cant-ping-from-inside-of-the-vm-any-local-sites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!