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.

edit: (for clarification)

I have two servers. Server 1 has a static IP, and server2 has a dynamic hostname using DDNS services. both servers are running Ubuntu 12.04 lts, and virtualmin.

on server 1, we are running bind9, and and it has a Master Zone for its official domain, lets call it MyWebsite.com

server two (2), can be accessed via server2.mywebsite.com. we have already created a CNAME record, which points to its hostname provided by DDNS services

our problem is understanding how to get server 2 to a add a simple CNAME record to the primary machine's Master Zone file for the domain.

all we need to do is add a record similar to this:

user1.mywebsite.com -> CNAME -> server2.mywebsite.com

to the Master Zone file for the domain On the primary server.

(this is already working in practice. we need a way to have the template automatically add a CNAME record to the primary machines bind9 master zone file setup upon creation. at this moment, we are doing it by hand)

Thank you!

share|improve this question

closed as unclear what you're asking by Jenny D, Ward, mdpc, Nathan C, mgorven Jul 12 '13 at 21:20

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
"even if it just adds ONE cname.." What is "it"? The server hardware can't do it, so what software are you talking about? And you can't point a CNAME to an IP Address, otherwise it would be an A record, so share some more information with us so we can give you better answers without taking stabs in the dark. –  fukawi2 Jul 12 '13 at 5:41
    
the idea would be for SERVER 2 to add a cname record to SERVER1 under the master zone. simply needs to add user.mywebsite.com -> server2.mywebsite.com. my problem is that i am having trouble figuring out how to add a CNAME records to the master zone on server 1. –  RapidWebs Jul 12 '13 at 14:28
    
i edited my question for clarification –  RapidWebs Jul 12 '13 at 14:44

1 Answer 1

up vote 0 down vote accepted

I'd look into using nsupdate.

You could run it on server2 out of cron.

update add www1.example.com 86400 a 172.16.1.1

update add www.example.com 600 cname www1.example.com.

send

update add 1.1.16.172.in-addr.arpa 86400 ptr www1.example.com.

send

Note, however, that chaining CNAMES is discouraged. See, eg, RFC 1034.

share|improve this answer
    
while this wasn't exactly what i needed to fix my problem, it may be of critical use in the future, and was one of many posts which help me gain a greater general understanding in parts of the DNS protocol which i had not before: answer selected –  RapidWebs Jul 13 '13 at 12:01

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