February 19, 2009 3:00 pm GMT

How to set up AdSense for Domains on cPanel-WHM

by Gary Illyes


What you have to understand from the very beginning is that Google can show advertisements on your parked domain only if you clearly specify in your DNS that the content for those domains should be served from the Google servers, not yours. Probably it would have been a better idea on Google’s end to just change the domains’ nameservers you want to park, though. I want to say that I don’t really understand why did they chose this setup. But it works, and that’s the important, so whatever.
What you have to do is to basically add the domains you want to park in your AdSense account, then add or change some A and CNAME records in your DNS. Let’s see the actions you have to take step-by-step.
If you have a cPanel account only and you don’t have access to the server’s DNS, you can still use this guide and inform the server administrator about the steps he/she has to follow (or just send them the link to this article).

  1. The very first step is to let Google know which domains you want to park. Head to the AdSense setup tab in your AdSense account, then click the AdSense for Domains link. Click the Add new domains link if you already added domains to your AdSense account. You will face a screen like this:
    AdSense for Domains - adding new domains

    AdSense for Domains - adding new domains


    Add the domains you want to park in the field reserved for this purpose and click Add Domain(s). You will be presented information regarding what modification you will have to make in your DNS. Leave this window/tab open, you will need that information.
  2. Enter WHM and head to the DNS Functions >> Edit DNS Zone section of WHM.
  3. Select from the list the domain you want to park with AdSense and click edit
  4. You will be faced with a table like this:
    WHM - Editing DNS zone

    WHM - Editing DNS zone

  5. Scroll down to the end of the page’s end, you will be faced with a form where you can enter new, additional records to this DNS zone. Enter here the A records you got from AdSense. The “@” sign is the shortcut for the domain name you manage followed by a dot.
  6. Scroll up again and find the row which first field contains the “www” text. In the last field of this row enter the your publisher ID followed by “.afd.ghs.google.com.”, note the dot from the end of the domain! When you finished this step, your WWW CNAME field should look like this:
    www 14400 IN CNAME pub-1234567890123456.afd.ghs.google.com.
  7. hit save, and you’re done. Google will approve your request in no time and your domain will start serving ads

What problems can occur?

You mistakenly make two CNAME records for WWW, the original and the one provided by Google. This can be corrected by emptying all the fields from the old CNAME WWW record’s row. Just simply delete everything from the fields from within the old CNAME row and hit save.
You leave the domain’s old A record and your domain will serve the original content, not the ads as you would like to. Again, simply delete that old A record by emptying all the fields in the row.


Comments

One Comment on " How to set up AdSense for Domains on cPanel-WHM "

  1. Jeremy Moseley on Sat, 21st Feb 2009 12:49 am  

    Thank you! I wasn’t sure that I needed to replace the www part. Also I learned something new with the @ alias.

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

If you want to use your OpenID, fill out the field labeled "Website" with the OpenID URL. The other fields may remain empty.
Note that comments are pre-moderated.

Subscribe without commenting