✓ Solved
How do I point a subdomain to different ip to host a service ?
I have a domain example.com setup under linode/Domains that has A/AAAA Record pointing to old website, now I am also self hosted cloud storage service on 443 on a different ip address. I want to point cloud.example.com to this new ip address. Can anyone please point me how should I do this ?
2 Replies
✓ Best Answer
Take a look through this guide: https://www.linode.com/docs/guides/dns-manager/
thank you , Now I am trying to update the domain ip but I get 400 response.
TOKEN = 'abcdefghigjlmnopq_assumed_example'
PAYLOAD = {
"type": "A",
"name": "test",
"target": '192.168.1.1',
"priority": 50,
"weight": 50,
"port": 80,
"ttl_sec": 604800
}
URL = "https://api.linode.com/v4/domains/{did}/records/{rid}".format(did=1111111, rid=2222222)
def main():
headers = {
'content-type': 'application/json',
'Authorization': 'Bearer {tkn}'.format(tkn=TOKEN)
}
resp = requests.put(URL, data=json.dumps(PAYLOAD), headers=headers)
print(resp.status_code)
if __name__ == '__main__':
main()
Fixed