我想知道如何为仅限于第一级子域名设置通配符DNS,例如:
user.example.com // valid
www.user.example.com // invalid
我已经按以下方式配置了我的BIND区域域名:
; example.com
$TTL 86400
@ IN SOA ns.example.com. domain.example.com. (
2014021001 ; Serial
28800 ; Refresh
1800 ; Retry
604800 ; Expire - 1 week
86400 ) ; Minimum
IN NS ns
IN NS ns1
ns IN A 1.2.3.4 ; An IP
ns1 IN A 1.2.3.4 ; An IP
@ IN A 1.2.3.4 ; An IP
*.example.com IN A 1.2.3.4 ; An IP
www IN A 1.2.3.4 ; An IP
@ IN TXT "v=spf1 a mx -all"
我的Apache虚拟主机配置如下:
<VirtualHost 1.2.3.4:80>
ServerAdmin domain@example.com
DocumentRoot /var/www/html/example.com
ServerAlias www.example.com
ServerName example.com
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
</VirtualHost>
<VirtualHost 1.2.3.4:80>
ServerAdmin domain@example.com
DocumentRoot /var/www/html/apps.example.com
ServerAlias *.example.com
ServerName apps.example.com
ErrorLog logs/apps.example.com-error_log
CustomLog logs/apps.example.com-access_log common
</VirtualHost>
Please help!