title: How do I test a Cloudfront Distribution with the same CNAME as an existing Distribution?
body: <p>Our team uses Cloudfront to act as a cache + dynamic reverse proxy so that:</p>
  
  <blockquote>
    <p>example.com/foo</p>
  </blockquote>
  
  <p>is directed to our Foo elasticbeanstalk environment and</p>
  
  <blockquote>
    <p>example.com/bar</p>
  </blockquote>
  
  <p>is directed to our Bar elasticbeanstalk environment.</p>
  
  <p>Now, we have been working on a pretty hefty rearchitecting of some of our <code>example.com</code> services, and now we will want <code>example.com/foo</code> to go to our Foo2 environment, and some other things such as <code>example.com/baz</code> to Baz, and so on (while keeping some existing rules such as <code>/bar</code> to Bar).</p>
  
  <p>We would like not to just "flip the switch" and do it in production, and would like to test our configuration beforehand. So we set up another distribution with the new behaviors and put benign sample applications for <code>Foo2</code> and <code>Baz</code>.  But of course - we cannot set the <code>example.com</code> CNAME on this other distribution, because our CURRENT distribution already uses it.</p>
  
  <p>When we tried to "verify" by editing our <code>/etc/hosts</code> file to point <code>example.com</code> to one of the IP addresses from one of the A records from our <em>new</em> distribution, Cloudfront appeared to just behind the scenes see that we were trying to request the host <code>example.com</code> and routed requests to the environments specified by the behaviors in our <em>current</em> distribution.</p>
  
  <p><strong>Is there any way we can test and verify Cloudfront ruleset changes to a distribution with an existing CNAME without changing the behaviors and rules applied to the current distribution?</strong></p>