CANID(1)

πŸ“¦ version 0.0~git20180613.007c9af, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 canid(1) 🌸

okay bestie, welcome to canid(1) β€” the manual page for the caching additional network information daemon. yes that's its whole government name. sit down, grab a strawberry πŸ“, we're doing network lookups but cute.


✨ NAME ✨

canid β€” the caching additional network information daemon πŸ¦‹


✨ SYNOPSIS ✨

canid [-file cachefile] [-expiry sec] [-concurrency n] [-port port]

✨ DESCRIPTION ✨

so basically canid is a little web service that caches and simplifies info it pulls from other services (go peek at BACKENDS below, iykyk) about Internet hostnames and IP addresses. it exists for when you're looking up many addresses and/ …

πŸ’€ not me pointing out that the sentence literally just stops at "and/" in the original. no cap. it's giving cliffhanger. we move.

the moment you launch it, canid starts serving on the port you told it to. and it shuts down cleanly on SIGINT (that's ^C on the console, bestie β€” ctrl-c and she leaves gracefully, main character exit πŸ‘‘).


✨ OPTIONS ✨

  • -file cachefile β€” use this JSON file as a backing store for the cache. default: no backing store (so, nothing gets remembered between runs πŸ™ˆ). it loads the cache from this file on startup, and saves it on termination. periodt.
  • -expiry sec β€” expire cache entries after sec seconds. default: 86400, which is one whole day 🌈.
  • -concurrency n β€” allow at most n simultaneous pending requests per backend. default: 16.
  • -port port β€” TCP port to listen on. default: 8043 πŸ’….

✨ RESOURCES ✨

canid serves three resources over HTTP. three. a trio. iconic behavior.

  • / the root resource. it's an HTML page giving you a simple web front-end to the service. yes, a whole vibe, rendered in your browser πŸŽ€.
  • /prefix.json?addr= look up info about the prefix associated with an address, and it comes back as a JSON object. right now that object contains a Prefix key with the routed prefix associated with the address, an ASN key with a BGP autonomous system number associated with the address, and a CountryCode key for an ISO 3166 country code associated with the address. so much lore in one little object 🫢.
  • /address.json?name= look up an Internet hostname via DNS, and get back the IPv4 and IPv6 addresses associated with it as a JSON object. this object contains a Name key with the name looked up, and an Addresses key containing an array of IPv4 and/or IPv6 addresses as strings. and here's the tea: looking up an address for a name will cause prefix information for all addresses found to be cached, as well. two-for-one, we love efficiency ✨.
every single JSON resource also carries a Cached key β€” that's the time at which the data entry was put into the cache, in [RFC3339](https://datatracker.ietf.org/doc/RFC3339) format. timestamps are the moment, fr fr.

✨ BACKENDS ✨

  • the prefix.json resource currently uses the Prefix Overview and Geolocation API entry points from [RIPEstat](https://stat.ripe.net). shoutout.
  • the address.json resource uses DNS, as provided by the Go standard library's net.LookupIP() β€” that's the system resolver, bestie, doing its thing 🧚.

✨ AUTHOR ✨

Brian Trammell brian@trammell.ch πŸ’œ


✨ LICENSE ✨

Copyright (c) 2016 - 2018 Brian Trammell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


and that's the whole page, bestie πŸŽ€ this one's dated February 2018 and it lives under the manual name CANID(1). go look up some addresses, you got this πŸ’…πŸ”₯