update_dns
Modify DNS records for domains by changing record type, name, value, or TTL to update website routing, email configuration, or security settings.
Instructions
Update an existing DNS record for a domain.
NOTE: Updating a record will change its record id.
domain_id: Domain UUID (e.g., 'd1234567-89ab-cdef-0123-456789abcdef')
record_id: DNS record UUID to update
type: DNS record type ('A', 'AAAA', 'CNAME', 'MX', 'TXT', etc.)
name: Subdomain or record name (e.g., 'www' for www.yourdomain.com)
value: New record value (e.g., IP address for A records)
ttl: Time To Live in seconds (default: 3600)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain_id | Yes | ||
| record_id | Yes | ||
| type | No | TXT | |
| name | No | test-2 | |
| value | No | test-2 | |
| ttl | No |
Implementation Reference
- src/sherlock_mcp/server.py:182-195 (handler)The handler function for the 'update_dns' MCP tool. It is decorated with @mcp.tool() for registration and executes the tool logic by calling the underlying Sherlock client's _update_dns_record method, then wraps the response using handle_response.@mcp.tool() async def update_dns(domain_id: str, record_id: str, type: str = "TXT", name: str = "test-2", value: str = "test-2", ttl: int = 3600): """ Update an existing DNS record for a domain. NOTE: Updating a record will change its record id. domain_id: Domain UUID (e.g., 'd1234567-89ab-cdef-0123-456789abcdef') record_id: DNS record UUID to update type: DNS record type ('A', 'AAAA', 'CNAME', 'MX', 'TXT', etc.) name: Subdomain or record name (e.g., 'www' for www.yourdomain.com) value: New record value (e.g., IP address for A records) ttl: Time To Live in seconds (default: 3600) """ return handle_response(get_sherlock()._update_dns_record(domain_id, record_id, type, name, value, ttl))
- src/sherlock_mcp/server.py:182-182 (registration)The @mcp.tool() decorator registers the update_dns function as an MCP tool.@mcp.tool()
- src/sherlock_mcp/server.py:183-195 (schema)Input schema defined by function parameters with type hints and detailed docstring describing parameters and usage.async def update_dns(domain_id: str, record_id: str, type: str = "TXT", name: str = "test-2", value: str = "test-2", ttl: int = 3600): """ Update an existing DNS record for a domain. NOTE: Updating a record will change its record id. domain_id: Domain UUID (e.g., 'd1234567-89ab-cdef-0123-456789abcdef') record_id: DNS record UUID to update type: DNS record type ('A', 'AAAA', 'CNAME', 'MX', 'TXT', etc.) name: Subdomain or record name (e.g., 'www' for www.yourdomain.com) value: New record value (e.g., IP address for A records) ttl: Time To Live in seconds (default: 3600) """ return handle_response(get_sherlock()._update_dns_record(domain_id, record_id, type, name, value, ttl))
- src/sherlock_mcp/server.py:19-31 (helper)Helper function used by update_dns (and other tools) to standardize Sherlock API responses into MCP-compatible format.def handle_response(response): """ Handle responses from Sherlock methods. Sherlock methods already process the response using _handle_response, which returns either a processed JSON object for successful requests or the response object itself. """ if hasattr(response, 'status_code'): # This is a raw response object try: return response.status_code, response.json() except: return response.status_code, response.text # This is already processed data (like a dictionary) return response