canid1
The caching additional network information daemon
Usage
canid [-file
cachefile]
[-expiry
sec]
[-concurrency
n]
[-port
port]
Overview
Canid provides a simple web service for caching and simplifying information retrieved from other services (see BACKENDS) about Internet hostnames and IP addresses. It is designed for use when looking up many addresses and/
On launch, Canid begins serving on the specified port. It shuts down cleanly on SIGINT (^C on the console).
Options
- •
-
-filecachefile (default: no backing store) Use the given JSON file as a backing store for the cache. Loads the cache from this file on startup, and saves it on termination.
- •
-
-expirysec (default: 86400, 1 day) Expire cache entries after sec seconds.
- •
-
-concurrencyn (default: 16) Allow at most n simultaneous pending requests per backend.
- •
-
-portport (default: 8043) TCP port to listen on
Resources
Canid provides three resources via HTTP:
- •
-
/
-
The root resource is an HTML page providing a simple web front-end to the service.
- •
-
/prefix.json?addr=
-
Look up information about the prefix associated with an address, and return it as a JSON object. This object presently contains a
Prefixkey with the routed prefix associated with the address, an ASN key with a BGP autonomous system number associated with the address, and aCountryCodekey for an ISO 3166 country code associated with the address.
- •
-
/address.json?name=
-
Look up an Internet hostname via DNS, and return the IPv4 and IPv6 addresses associated with it as a JSON object. This object contains a
Namekey with the name looked up, and anAddresseskey containing an array of IPv4 and/or IPv6 addresses as strings. Looking up an address for a name will cause prefix information for all addresses found to be cached, as well.
All JSON resources also contain a Cached key, the time at which the data entry was put into the cache in [RFC3339][https://datatracker.ietf.org/doc/RFC3339] format.
Backends
The prefix.json resource currently uses the Prefix Overview and Geolocation API entry points from [RIPEstat][https://stat.ripe.net].
The address.json resource uses DNS, as provided by the Go standard library´s net.LookupIP() (i.e., the system resolver)
Releases
Unchanged in 4 releases since Debian 10 (Buster).