Problem
I’m now using Zone Edit to handle the zone record for new domains. It gives far more control over the zone, and is very quick with updates etc. I needed to setup one particular domain so that all traffic to that it – and any subdomains – went to one IP address. A ‘catchall’ if you like.
For example: ‘myquickfix.co.uk’ and ‘www.myquickfix.co.uk’ have A records pointing to 82.109.178.44. If I needed the subdomain ‘pants.myquickfix.co.uk’ to point to that IP also, I could add a CNAME record, or another A record. But if I need lots of subdomains all pointing to the same IP, it’s far easier to add a wildcard A record.
Resolution
Wildcard entries are represented by an asterisk (*) and will send all requests that aren’t covered by other entries, to the specified IP. Shown below are the relevant ZoneEdit screens where this can be setup:
An asterisk is entered for Name, and the destination in Numperic IP
Note: There are already entries for the domain, ‘www’ and ‘mail’. But we want to add the wildcard / catchall record in the fields above ‘Add New IP Address’. By the way, this is done in the ‘IP Addresses (A)’ screen.
After the wildcard entry is added, it appears in the list
The entry now appears in the list. If you wait for a few minutes and try to browse to a random subdomain of your domain, it should work. Woo!
A few notes:
If you’ve tried the subdomain in your browser before adding the wildcard, you might get a 404 error or just a blank page because the browser has cached the result from lastime. To get around this, clear your browsers cache, and flush your DNS cache. In Windows this is done by opening a command prompt and typing: “ipconfig /flushdns”.
If you try and click on the link that appears with the asterisk in ZoneEdit, it is very unlikely to work. The browser will try and URL encode the address turning ‘*.domain.co.uk’ into ‘%2A.domain.co.uk’ and you’ll get an Invalid Hostname error (400).
Any thoughts? please comment.
0 comments:
Post a Comment