Question about wildcard dns
6 Replies
peter@fremont ~ $ dig @ns1.linode.com any avidblog.us
; <<>> DiG 9.4.1-P1 <<>> @ns1.linode.com any avidblog.us
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29829
;; flags: qr aa rd; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 5
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;avidblog.us. IN ANY
;; ANSWER SECTION:
avidblog.us. 86400 IN SOA ns1.linode.com. sync95.gmail.com. 2009032878 7200 7200 1209600 86400
avidblog.us. 86400 IN NS ns3.linode.com.
avidblog.us. 86400 IN NS ns1.linode.com.
avidblog.us. 86400 IN NS ns2.linode.com.
avidblog.us. 86400 IN NS ns4.linode.com.
avidblog.us. 86400 IN MX 10 mail.avidblog.us.
avidblog.us. 86400 IN A 209.123.234.214
;; ADDITIONAL SECTION:
ns1.linode.com. 3600 IN A 69.93.127.10
ns2.linode.com. 3600 IN A 65.19.178.10
ns3.linode.com. 3600 IN A 75.127.96.10
ns4.linode.com. 3600 IN A 207.192.70.10
mail.avidblog.us. 86400 IN A 209.123.234.214
;; Query time: 43 msec
;; SERVER: 69.93.127.10#53(69.93.127.10)
;; WHEN: Sun Mar 29 18:03:07 2009
;; MSG SIZE rcvd: 277
````
No wildcard?
$TTL 86400
@ IN SOA ns1.linode.com. sync95.gmail.com. (
2009032973
7200
7200
1209600
86400
)
@ NS ns1.linode.com.
@ NS ns2.linode.com.
@ NS ns3.linode.com.
@ NS ns4.linode.com.
@ MX 10 mail.avidblog.us.
@ A 209.123.234.214
www A 209.123.234.214
mail A 209.123.234.214
- A 209.123.234.214
````
The records here show that I did put it in.
$TTL 14440
@ IN SOA ns1.linode.com. info.example.net. (
2009032972
7200
7200
1209600
14440
)
@ NS ns1.linode.com.
@ NS ns2.linode.com.
@ NS ns3.linode.com.
@ NS ns4.linode.com.
@ MX 10 mx00.1and1.com.
@ MX 10 mx01.1and1.com.
@ A 11.22.33.44
* A 11.22.33.44
justatest A 111.222.111.222
And results from dig:
$ dig example.net any
; <<>> DiG 9.3.2 <<>> example.net any
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1070
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 3
;; QUESTION SECTION:
;example.net. IN ANY
;; ANSWER SECTION:
example.net. 14440 IN A 11.22.33.44
example.net. 14440 IN NS ns2.linode.com.
example.net. 14440 IN NS ns3.linode.com.
example.net. 14440 IN NS ns4.linode.com.
example.net. 14440 IN NS ns1.linode.com.
example.net. 14440 IN SOA ns1.linode.com. info.example.net. 2009032972 7200 7200 1209600 14440
example.net. 14440 IN MX 10 mx00.1and1.com.
example.net. 14440 IN MX 10 mx01.1and1.com.
;; ADDITIONAL SECTION:
ns2.linode.com. 77979 IN A 65.19.178.10
ns4.linode.com. 148 IN A 207.192.70.10
ns1.linode.com. 3259 IN A 69.93.127.10
;; Query time: 333 msec
;; SERVER: 25.13.7.2#53(25.13.7.2)
;; WHEN: Sun Mar 29 19:23:35 2009
;; MSG SIZE rcvd: 269
$ dig foo.example.net
; <<>> DiG 9.3.2 <<>> foo.example.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17989
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;foo.example.net. IN A
;; ANSWER SECTION:
foo.example.net. 14440 IN A 11.22.33.44
;; Query time: 230 msec
;; SERVER: 25.13.7.2#53(25.13.7.2)
;; WHEN: Sun Mar 29 19:18:30 2009
;; MSG SIZE rcvd: 54
$ dig justatest.example.net
; <<>> DiG 9.3.2 <<>> justatest.example.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4622
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;justatest.example.net. IN A
;; ANSWER SECTION:
justatest.example.net. 14440 IN A 111.222.111.222
;; Query time: 236 msec
;; SERVER: 25.13.7.2#53(25.13.7.2)
;; WHEN: Sun Mar 29 19:18:39 2009
;; MSG SIZE rcvd: 60
Every subdomain name comes out as 11.22.33.44 except for justatest. I think you won't ever see a wildcard entry from the outside, because it's internal to the nameserver.
If you using apache with virtual hosts - move the catch-all VirtualHost directive so that it occurs after the one for community.avidblog.us. Apache processes the VirtualHost directives in the order it encounters them so you want it to find the community one before that matches the catch-all.
That makes it way too easy for some disgruntled person or even a total nutjob to set up a blog or website that points to http://
Then by some SEO tricks, the ne'er-do-well gets that ranked highly when someone does a search for
If you really, really must do wildcards, do so but be aware of some of its risks. If at all possible, it's usually safer to do some rewriting tricks + dns records for the commonly misspelled names.