[READ-ONLY] Mirror of https://github.com/danielroe/domain-sync. A tiny script that migrates all my Gandi domains to use Cloudflare DNS.
cloudflare dns gandi script
0

Configure Feed

Select the types of activity you want to include in your feed.

domain-sync / index.ts
641 B 21 lines
1import { createNewDomain } from './api/cloudflare' 2import { getNameservers, listDomains, setNameservers } from './api/gandi' 3 4const domains = await listDomains() 5 6for (const domain of domains) { 7 console.log(`--- ${domain.fqdn} ---`) 8 9 if (domain.nameserver.current === 'other') { 10 const nameservers = await getNameservers(domain.fqdn) 11 if (nameservers.some(n => n.includes('cloudflare'))) { 12 continue 13 } 14 } 15 16 console.log('Creating new domain on Cloudflare') 17 const response = await createNewDomain(domain.fqdn) 18 19 console.log('Setting new nameservers') 20 await setNameservers(domain.fqdn, response.result.name_servers) 21}