diagnose geoip
Use these commands to diagnose the geography IP database and service.
diagnose geoip ip2country <IP_address> Find the country that corresponds to the specified IPv4 or IPv6 address. diagnose geoip geoip-query <IPv4_address> View the geography information for the specified IP address.
Example output
This is sample output of the diagnose geoip ip2country command:
# diagnose geoip ip2country 65.55.50.158
65.55.50.158 - United States
This is sample output of the diagnose geoip geoip-query command:
# diagnose geoip geoip-query 65.55.50.158
IP:65.55.50.158
{"city":{"geoname_id":5807713,"names":{"en":"Quincy"}},"continent":{"code":"NA","names":{"en":"North America"}},"country":{"iso_code":"US","names":{"en":"United States"}},"subdivisions":[{"iso_code":"WA","names":{"en":"Washington"}}],"location":{"latitude":47.234299,"longitude":-119.852547,"time_zone":"America/Los_Angeles"},"postal":{"code":"98848"}}