#Change the following cloudflareEmail="CFEMAIL@EG.COM" #CF Login Email Address cloudflareAPIkey="yourlonglowercaseandnumberapikey" #API Key as shown on https://www.cloudflare.com/my-account #the following credentials will update the A record for example.thebasedomainname.com with the IP address of the connecting machine baseDomain='thebasedomainname.com' #Domain Name as shown on https://www.cloudflare.com/my-websites.html recordType='A' #See "Type" Column on https://www.cloudflare.com/dns-settings?z=example.com recordName='example' #See "Name" Column on https://www.cloudflare.com/dns-settings?z=example.com import os,re import urllib import sys #Find the CloudFlare ID of your (sub)domain based on the recordName and recordType data={'a': 'rec_load_all','tkn': cloudflareAPIkey,'email': cloudflareEmail,'z': baseDomain} data = urllib.urlencode(data) f = urllib.urlopen("https://www.cloudflare.com/api_json.html", data) recloadall=f.read() #print recloadall recloadall=recloadall[0:recloadall.find('"display_name":"'+str(recordName)+'","type":"'+str(recordType)+'"')] recordID=recloadall[recloadall.rfind("rec_id")+9:recloadall.find('","',recloadall.rfind("rec_id")+9)] #print recordID if recordID.find(':"error"')>-1: recordID=recordID[recordID.find('"msg":"')+6:recordID.find(",",recordID.find('"msg":"')+3)] print "CF Record:",recordID #Get your current device IP Address f = urllib.urlopen("http://ip-api.com/xml") ipe=f.read() ip=ipe[ipe.find("",ipe.find("