1

Is it possible to make CNAME's switch it's data every minute (or possibly even shorter) ?

I'm currently trying to make something that changes my CNAME every minute but i have no idea if this is even possible.

So far i have tried different values for the TTL in the zone file (currently TTL: 60) but it seems that the CNAME doesn't mitigate when i ping from a different computer.

{
    "$origin": "example.com.",
    "$ttl": 10,
    "soa": {
        "mname": "NS1.EXAMPLE.COM.",
        "rname": "ROOT.EXAMPLE.COM.",
        "serial": "{time}",
        "refresh": 10,
        "retry": 600,
        "expire": 604800,
        "minimum": 86400
    },
    "ns": [
        { "host": "NS1.EXAMPLE.COM." },
        { "host": "NS2.EXAMPLE.COM." }
    ],
    "a": [
        { "name": "@", "ip": "myip" },
        { "name": "ns1", "ip": "myip_ns1" },
        { "name": "ns2", "ip": "myip_ns2" }
    ],
    "cname":[
        { "name": "wwww", "alias": "www.google.com." },
        { "name": "test", "alias": "www.bing.com." }
    ]
}

In the above example (in JSON format for ease of use) i have configured 2 CNAME domains, a NodeJS script will make sure that CNAME's are changed every minute (or given interal). for example, it will change the cname alias of "test" to "yahoo.com" rather than "bing.com".

When i check the zone file after the change, it appears to be valid, however it doesn't take effect on other hosts for a long while (perhaps after 1h or so it will work) meanwhile pinging from a different host

i am using bind9 on an ubuntu machine

Maxim
  • 105
  • 3
  • What do you mean by "doesn't take effect on other hosts"? – gxx Dec 09 '15 at 20:52
  • What is this being used for? Could you achieve the desired effect by modifying the hosts file instead? – D34DM347 Dec 09 '15 at 21:02
  • For example, i ping the cname test.mydomain.com from my windows machine. it should use the cname to provide me a different domain every 60 seconds. this can not be achieved by editing the hosts file – Maxim Dec 09 '15 at 21:11

0 Answers0