laravel ERR_ICANN_NAME_COLLISION 在主机文件中使用 url 而不是 ip
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36026378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ERR_ICANN_NAME_COLLISION Using a url instead of ip with hosts file
提问by user3743266
I'm trying to use laravel homestead and redirect "homestead.dev" to "192.168.10.10". I can see the website using the IP but not "homestead.dev".
我正在尝试使用 laravel homestead 并将“homestead.dev”重定向到“192.168.10.10”。我可以看到使用 IP 的网站,但看不到“homestead.dev”。
I get this error:
我收到此错误:
ERR_ICANN_NAME_COLLISION
Pinging homestead.dev responds with 127.0.53.53. I can access the website with this also: http://127.0.53.53:8000/.
Ping homestead.dev 响应 127.0.53.53。我也可以通过这个访问网站:http: //127.0.53.53: 8000/。
My homestead.yaml:
我的 homestead.yaml:
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: homestead.dev
to: /home/vagrant/Code/myApp/public
databases:
- myApp
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
hosts file:
主机文件:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
192.168.10.10 homestead.dev
回答by user3743266
I finally solved it. Problem was with hosts file. This post helped me fix it: https://serverfault.com/a/452269.
我终于解决了。问题出在主机文件上。这篇文章帮我解决了这个问题:https: //serverfault.com/a/452269。
When changing hosts file, instead of copying and replacing, I moved and replaced it, and so the permissions got changed.
更改hosts文件时,我没有复制和替换,而是移动并替换了它,因此权限发生了变化。
回答by Alexey Mezenin
Looks like name collision, try to use different name, for example myapp.dev
看起来像名称冲突,尝试使用不同的名称,例如 myapp.dev
Also, you you can try to add this to your hosts
file:
此外,您可以尝试将其添加到您的hosts
文件中:
127.0.53.53 homestead.dev
Then use homestead.dev:8000
in your browser.
然后homestead.dev:8000
在浏览器中使用。
Also try to reboot PC after that.
之后也尝试重新启动PC。