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.

I am trying to configure my computer to run its own DNS server. The only thing I want to do is to forward all requests for my.example.com to my-staging.example.com. So, when I would use a phone, who's DNS is my computer, the requests would also be redirected.

I can't seem to figure out what exactly should the zone file contain, could anyone please help ?

I tried:

example.com. 7200   IN SOA ns1.example.com. ( 
                         2008010402 
                         15 
                         3600 
                         3000000 
                         86400 )
                    IN NS example.com
my.example.com.     IN A   213.144.138.203

but does not seem to work.

Any help is greatly appreciated.

Thanks.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You are going to want to use a CNAME record to setup the alias. Once you have yoru basic headers and ruls in place, you'll need something like this:

my   IN   CNAME my-staging.example.com.

(Note trailing dot is important.)

However since this dns file will be hosting the DNS for example.com, you also need a way to resolve the my-staging address. You can do this by seting a static A record or by using an alternate name if it has one.

my-staging   IN   A xxx.xxx.xxx.xxx

or

my-staging   IN   CNAME alternate.dns.name.for.mystagingexample.com.
share|improve this answer
add comment

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.