大网数据广告活动
服务器运维问答

It is possible to point some specific subdomains to a DNS server using Wildcard subdomain?

· 52CE 我爱测

Assuming example.com domain and fake IPs, the configuration needed is this: example.com points to 186.200.1.1 www .example.com points to 186.200.1.1 adm .example.com points to 186.200.1.1 online .example.com points to 186.200.1.2…

问题原文

原帖链接 · Rodrigo · CC BY-SA 4.0

Assuming example.com domain and fake IPs, the configuration needed is this:

  • example.com points to 186.200.1.1
  • www.example.com points to 186.200.1.1
  • adm.example.com points to 186.200.1.1
  • online.example.com points to 186.200.1.2
  • store.example.com points to 186.200.1.3
  • *.example.com points to 186.200.1.5

That is, we have two rules:

  1. Subdomains www, adm, online and store have their specific servers.

  2. Any subdomain of example.com, except www, adm, online and store, should point to 186.200.1.5 server.

It's possible archieve that using only DNS records?

已采纳解答

原帖链接 · Steve · CC BY-SA 3.0

Yes, it is extremely possible! If you add an A record for *.example.com, it will resolve all non-existent domain names to the specified IP address. See: http://en.wikipedia.org/wiki/Wildcard_DNS_record

For example, if your records looked like this:

*.example.com -> 8.8.8.8
a.example.com -> 8.8.4.4

It would mean:

a.example.com resolves to 8.8.4.4
b.example.com resolves to 8.8.8.8
c.example.com resolves to 8.8.8.8

Sub-domains B & C were not specified, which is why they fall back on the wildcard record! :)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-02-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。