Showing posts with label Add domain (DNS) Wildcard/catchall (*) entries with Zoneedit. Show all posts
Showing posts with label Add domain (DNS) Wildcard/catchall (*) entries with Zoneedit. Show all posts

Resolving Domain Park Wrapper Errors

0 comments
If you run a more populated shared hosting server, sooner or later you’ll have received complaints about the dreaded park wrapper errors in cPanel that occur when a user tries to add a parked or addon domain to their cPanel. The errors may look like this:
Error from domain wrapper: domain.com is owned by another user.
Error from domain wrapper: Domain already exists, it was not added.
I’ve never really been able to attribute that error to a specific action, but my assumption is that it occurs as a result of the end user not completely removing the domain from their cPanel (i.e. hitting esc or closing the browser during removal), therefore not allowing cPanel to remove the domain’s entries to allow that domain to be re-added when certain security settings are enabled in WHM > Tweak Settings.
The easy solution to the first error is to enable the option for users to add domains owned by other users via WHM > Tweak Settings. But this is a very bad idea as it essentially allows users to repoint domains that you’re already hosting.
If you’re attempting to re-add a domain to a cPanel account and are getting one of the above errors, first check that the error needs to be corrected. Meaning, make sure that the domain in question isn’t already set up elsewhere. If it is, you would need to remove it from that account before being able to add it to another.
If the error is actually occurring due to an improperly removed domain, follow the below steps until you are able to add the domain back to the server:
  1. run /scripts/killdns <domain> on the server to remove the DNS records from the DNS cluster
  2. do grep -r <domain> /var/cpanel/users to see if it exists in a user file, and if so, delete the entry and run /scripts/updateuserdomains, make sure it’s remove from /etc/userdomains
  3. grep -r <domain> /var/cpanel/userdata to see if the domain appears in a user’s template. If so, remove any files based on the domain name (including .cache files), and remove any subdomain/parked/addon domain entries for that domain from the ‘main’ file located in that user’s folder (i.e. /var/cpanel/templates/username/main), then /scripts/rebuildhttpconf to remove it from httpd.conf .
This should allow you to re-add the domain name to the user’s cPanel without getting the park wrapper error.

How to add domain (DNS) Wildcard/catchall entries with Zoneedit

0 comments

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.