Changing the hostname on an instance modifies the default server configuration and reinstalls the operating system. This operation may results in data loss when the instance is reinstalled to apply the new hostname.
Follow this guide to change the hostname on a Vultr Cloud Compute instance using the Vultr Customer Portal, or API.
Navigate to Products and click Compute.
Click your target Vultr Cloud Compute instance to open its management page.
Navigate to the Settings tab.
Find and click Change Hostname on the left navigation menu.
Replace the existing value with your new hostname.
Click Reinstall to change your instance hostname.
Check the confirmation prompt and click Change Hostname to apply the new hostname.
Send a GET
request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH
request to the Update Instance endpoint and update the instance's hostname.
$ curl "https://api.vultr.com/v2/instances/{instance-id}" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"hostname" : "new-instance-hostname"
}'