IP地址(Internet Protocol Address)是互联网协议特有的一种地址,用来给互联网上的每一台计算机或设备分配一个唯一的地址。域名(Domain Name)则是为了便于记忆而对应于IP地址的一种符号表示。
DNS(Domain Name System,域名系统)负责将域名解析成对应的IP地址,使得用户可以通过输入域名来访问网站。
在DNS解析中,常见的记录类型有:
一个IP地址对应两个网站域名解析的应用场景通常出现在以下情况:
这通常是由于DNS缓存或服务器配置不当导致的。
ipconfig /flushdns
在Windows上,或sudo systemd-resolve --flush-caches
在Linux上)清除DNS缓存。VirtualHost
指令来定义不同的网站。server
块来定义不同的网站。server {
listen 80;
server_name example1.com;
location / {
root /var/www/example1;
index index.html index.htm;
}
}
server {
listen 80;
server_name example2.com;
location / {
root /var/www/example2;
index index.html index.htm;
}
}
领取专属 10元无门槛券
手把手带您无忧上云