# Host Name API

This service is used to add/delete local DNS entries:

# List Available Names

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

# Add 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

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 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: 10/30/2024, 8:40:52 PM