首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >/etc/hosts不能被浏览器读取?

/etc/hosts不能被浏览器读取?
EN

Stack Overflow用户
提问于 2018-04-03 22:19:16
回答 2查看 500关注 0票数 0

我在Linux Mint 18.1 Serena上。就在上周,我的机器开始出现奇怪的行为。我的/etc/hosts中有几个条目指向一些本地网站进行开发。由于一个不明显的原因,上周我的浏览器停止了解析这些域名的能力,但是使用curl我得到了一个有效的响应。我试着重启所有的东西,但是没有成功。

下面是我的/etc/hosts和/etc/nsswitch.conf的内容

代码语言:javascript
复制
127.0.0.1       localhost
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

172.27.0.4 dp-relaunch-coreshop.dp.dev
172.29.0.4 foodexplorer-coreshop.dp.dev


# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed,     try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

我希望有人能帮我解决这个问题。

EN

回答 2

Stack Overflow用户

发布于 2018-04-03 22:25:05

我可以看到你在Unix系统上,根据我的经验,我发现Chrome忽略了系统主机字段,尽管我在windows上。

确保运行浏览器的用户具有读取/etc/host/etc/nsswitch.conf文件的权限,并查看是否可以正常工作。

票数 0
EN

Stack Overflow用户

发布于 2018-09-27 00:30:07

似乎最近更新的浏览器对以*.dev结尾的本地域有问题,请尝试将其更改为*.local,然后重试。这解决了我的问题,尽管我不知道为什么

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49632411

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档