Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to setup CNAMEs without using an actual nameserver? This is for testing purposes on EC2 so any (hacky?) way of doing it would be good.

Or, if there's a light DNS server that's easy to configure, that'd be good as well.

I'm running Ubuntu 11.04 on EC2

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Do they need to be actual CNAME DNS entries ? If you just want test host names to resolve to your local machine you can just entries to the /etc/hosts file e.g.

1.2.3.4    test1.tld
1.2.3.4    test2.tld

where 1.2.3.4 is your local machines IP address.

Edit:

Why not just buy a cheap domain name to use for testing and use the tools provided by the company you bought it from to point to your ELB ?

I don't think there is a way to do this without using some sort of NameServer. If you look at this question & answer Alnitak suggests using unbound to do the name serving.

share|improve this answer
    
Thanks Iain, I do know about hosts file but unfortunately I'm trying to point to Amazon's ELB (load balancer) which doesn't have a dedicated IP and it's IP changes quite often. –  Andrei Serdeliuc Apr 8 '11 at 10:02

I think you will need a dynamic dns solution. Try something like DynDNS or FreeDNS.

FreeDNS is more free. What I mean is, you get more features with the free product than with DynDNS. I've used both services, and they both work fine.

If you're not familiar with these types of services, this is how they work:

  • First, set up the DNS settings
  • Second, set up a script to update DNS settings when the IP changes
  • Third, configure subdomains

I think you can piggy-back on someone else's domain if you like. I bought my own and got it configured in an hour or so using this guide.

share|improve this answer
    
The IP of the load balancer changes behind the scenes, without me knowing when this happens. There would be quite a lag if I use a dynamic DNS provider as I would have to keep pinging the LB and when the IP changes, ping DynDNS with the new IP, during that time I won't be able to access the instances behind the LB. –  Andrei Serdeliuc Apr 8 '11 at 10:38
    
How often does your IP change? –  tjameson Apr 8 '11 at 10:39
    
it's not predictable. It might change in a few minutes or hours. –  Andrei Serdeliuc Apr 8 '11 at 11:24

Your Answer

 
discard

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.