# Hostname API

This service is used to manage local DNS entries (add, delete, or update):

# List Available Hostnames

curl http://192.168.25.25:8090/hostnames/
[
  {
    "hostname": "local.autoxing.com",
    "url": "http://192.168.25.25:8090/hostnames/local.autoxing.com"
  }
]

# Add or Update a Hostname

curl -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"ip": "192.168.10.12"}' \
  http://192.168.25.25:8090/hostnames/local.autoxing.com
{
  "message": "192.168.10.12 local.autoxing.com added"
}
// status = 400
{
  "message": "error: local2.autoxing.com is not allowed. It must be one of ['local.autoxing.com']"
}

# Get Hostname Details

curl http://192.168.25.25:8090/hostnames/local.autoxing.com
{
  "ip": "192.168.20.20"
}
// status = 404
{
  "message": "error: local.autoxing.com not found"
}

# Delete a Hostname

curl -X DELETE http://192.168.25.25:8090/hostnames/local.autoxing.com
{
  "message": "error: Hostname local.autoxing.com deleted"
}
// status = 404
{
  "message": "error: local.autoxing.com not found"
}
Last Updated: 12/31/2025, 4:17:07 PM