Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Update: it's working by now. Turns out I was missing a valid DNS forwarder inside the named.conf.options file.

I'm trying to get internal DNS up and running on a EC2 instance. The main goal is to be able to define CNAME aliases for other AWS services. For example: Instead of using the RDS endpoint, which might change over time, an alias can be used instead.

I'm using bind9 and here's my config files:


zone "" {
    type master;
    file "/etc/bind/";


$TTL    3600
@       IN      SOA company.localhost. (
                   20120617         ; Serial
                     604800         ; Refresh
                      86400         ; Retry
                    2419200         ; Expire
                     604800 )       ; Negative Cache TTL
@ IN  NS
@ IN  A
@ IN  AAAA  ::1

mysql IN CNAME

The dig command ensures me my alias is working as excepted:

$ dig
;; ANSWER SECTION:  3600    IN  CNAME 60 IN CNAME 589575 IN A zzz.zz.zz.zzz

As far as I can understand a reverse zone isn't needed for a simple CNAME alias. However when I try to connect to MySQL using my newly created alias the operation is giving me a timeout.

$ mysql -uuser -ppassword
ERROR 2003 (HY000): Can't connect to MySQL server on '' (110)

Any ideas? Thanks in advantage!

share|improve this question
What is the output of getent hosts and telnet mysql? – mgorven Jun 18 '12 at 0:50

Is resolved to the IP address of the RDS endpoint on the computer you run the 'mysql' command on? We have a similar setup, but in our case 'dig' lists the actual IP address of the RDS endpoint in the answer section, i.e.:

$ dig
share|improve this answer
Yes, sorry I didn't include the whole dig response. See the updated post above. – mptre Jun 17 '12 at 13:29

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.