-1

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!

3
  • "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, 2013 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, 2013 at 14:28
  • i edited my question for clarification
    – RapidWebs
    Jul 12, 2013 at 14:44

1 Answer 1

0

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.

1
  • 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, 2013 at 12:01

Not the answer you're looking for? Browse other questions tagged .