【问题标题】:Differentiation of multiple domain hosted on same server区分托管在同一台服务器上的多个域
【发布时间】:2017-02-16 07:37:38
【问题描述】:

假设一台服务器(IP 地址为 123.123.123.123)托管 4 个域,名为 abc.xyz、abc.abc、xyz.abc、xyz.xyz。如果我 ping 任何网站,我将获得 ip 地址 123.123.123.123(因为域的 dns 名称是相同的 ip 地址)。但是当有人从浏览器请求从 abc.xyz 获取内容时,在数据包中浏览器只发送 ip 地址。那么服务器端如何区分用户请求的是哪个域呢?

【问题讨论】:

  • 查看 /etc/hosts 或您或您的操作系统主机文件 .. 那里的配置
  • 我有windows pc。
  • C:\Windows\System32\drivers\etc

标签: networking dns server


【解决方案1】:

因为你的操作系统是 Windows 看 C:\Windows\System32\drivers\etc\hosts 那里将包含 IP 地址到浏览器解析的主机名的映射

# 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-08
    • 2016-02-20
    • 1970-01-01
    • 2010-10-12
    • 2018-11-18
    • 2021-09-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多