Unify IP lookup response structure and add PTR lookups
- Always return consistent JSON structure with query and results array - Add PTR field to IPInfo for reverse DNS records - Support comma-separated IPs and hostnames in single query - Do PTR lookup for all IPs (direct, resolved from hostname, or listed) - Remove trailing dots from PTR records
This commit is contained in:
@@ -100,11 +100,12 @@ type ASInfo struct {
|
||||
|
||||
// IPInfo represents comprehensive IP information for the /ip endpoint
|
||||
type IPInfo struct {
|
||||
IP string `json:"ip"`
|
||||
Netblock string `json:"netblock"`
|
||||
MaskLength int `json:"mask_length"`
|
||||
IPVersion int `json:"ip_version"`
|
||||
NumPeers int `json:"num_peers"`
|
||||
IP string `json:"ip"`
|
||||
PTR []string `json:"ptr,omitempty"`
|
||||
Netblock string `json:"netblock"`
|
||||
MaskLength int `json:"mask_length"`
|
||||
IPVersion int `json:"ip_version"`
|
||||
NumPeers int `json:"num_peers"`
|
||||
// AS information
|
||||
ASN int `json:"asn"`
|
||||
ASName string `json:"as_name,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user