Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible with PHP to dynamically toggle CNAME entries? For example I have two mirrors with media to be served on my website. Mirror 1 has a monthly bandwidth cap so upon reaching it I want to automatically toggle to mirror 2.

I want to use CNAME because the resulting urls appear to be identical to search engines, an SEO friendly approach. If there are SEO friendly alternatives I'd like to hear them as well.

share|improve this question
up vote 1 down vote accepted

This totally depends on what options you have with the DNS server software you are using. Do you host your own DNS servers, or is that being provided for you by the hosting company you're using? If you're using your own DNS servers, you can script away using PHP, bash, Powershell, etc. If not, you're depending on whatever option your hosting company provides.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.