Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Utility to find geofeed files linked from rpsl.

License

NotificationsYou must be signed in to change notification settings

massimocandela/geofeed-finder

Repository files navigation

Info about geofeeds athttps://geolocatemuch.com/

If you only need a single file with all validated geofeed files discovered on WHOIS, you can download it athttps://geolocatemuch.com/ (bottom of the page). The file is updated daily with the utility in this repository.

This utility discovers and retrieves geofeed files from whois data. Additionally, it validates the ownership of the prefixes, manages the cache, and validates the ISO codes. SeeRFC9092/RFC9632.

To use the compiled version (linux, mac, windows), seereleases. Otherwise, you can just download the code and donpm ci andnpm run serve to run it.

How to set up a geofeed

Add a remark/comment in your inetnum/NetRange as follows:

Geofeed https://url_to_geofeed/file.csv

Example of result

$whois 209.212.224.1NetRange:       209.212.224.0 - 209.212.239.255CIDR:           209.212.224.0/20NetName:        NTTA-209-212-224NetHandle:      NET-209-212-224-0-1Parent:         NET209 (NET-209-0-0-0-0)NetType:        Direct AllocationOriginAS:       AS2914Organization:   NTT America, Inc. (NTTAM-1)RegDate:        1998-04-17Updated:        2020-12-18Comment:        Geofeed https://geo.ip.gin.ntt.net/geofeeds/geofeeds.csv

Geofeed-finder usage examples

If you just added a geofeed link in your inetnum/NetRange and you want to test that everything is fine:

  • Run the binary./geofeed-finder-linux-x64 -t YOUR_PREFIX

The -t option is not a prefix to geolocation lookup mechanism, but a test that your geofeed file is linked and constructed properly. This command will (1) find the parent inetnum for your prefix; (2) return all the geofeeds available for it; and (3) validate CSV format and ISO codes and report errors.

If you want to retrieve all the geofeeds in a RIR:

  • Run the binary./geofeed-finder-linux-x64 -i ripe
  • See the final geofeed file inresult.csv

You can select multiple RIRs:./geofeed-finder-linux-x64 -i ripe,apnic

If you want to discover geofeeds across all RIRs:

  • Run the binary./geofeed-finder-linux-x64
  • See the final geofeed file inresult.csv

The final geofeed file is a file containing all the geofeeds discovered in whois data.Each entry is a prefix or IP which has been selected according to the draft (e.g. accepted only if contained by parent inetnum, priority to longest prefix match, etc.)

The application accepts the following parameters:

ParameterDescription
-iInclude RIRs (comma-separated list). Possible values are ripe, apnic, lacnic, afrinic, and arin.
-vShow version number.
-oOutput file.
-tTest specific inetnum using RDAP.
-sSilent mode, don't print errors.
-cWhois cache validity (in days). Do not set, use the default instead.
-gGeofeed file cache validity (in days). Do not set, use the default instead.
-kKeep entries with invalid ISO codes. Not recommended.
-uKeep invalid subdivisions (accept invalid ISO regions/subdivisions, but keep validating the rest). Not recommended.
-rRemove invalid subdivisions but keep the rest of the geofeed if valid.
-zInclude Zip codes. Not recommended. Zip codes are deprecated in geofeed and by default are excluded from the output.
-dDownload timeout. Interrupt downloading a geofeed file after seconds. Default: 10 seconds.
-pDo not fetch arin sub allocations. You will save considerable time but have a potentially partial output.
-qDetect ARIN's sub allocations locally instead of downloading a dump file.
-aA comma-separated list of address families. Default:4,6.
-lCache directory. Default:.cache.

Use-h for more options. Seehere more information about-k,-u, and-r.

Downloading data from ARIN whois takes longer.This is because the other RIRs publicly provide anonymized bulk whois data.Instead, ARIN requires authorization to access bulk whois data.If you have such authorization, soon there will be an option to use ARIN bulk data, otherwise rdap is used (default, which doesn't require authorization.)

WARNING: do not remove the cache at each run and do not set cache vailidity values too small. If you do that, the risk that you get blocked by the data repositories is great.

Logs

All the logs, including ISO codes error are reported inlogs/.

Use geofeed-finder in your code

Install it:

npm install geofeed-finder

Import it:

importGeofeedFinderfrom"geofeed-finder";

Use it:

constoptions={include:["ripe","apnic"],// The RIRs to explore (default: ripe, apnic, lacnic, afrinic, arin),whoisCacheDays:3,// Cache days for whois data (default: 3)geofeedCacheDays:7,// Cache days for geofeed files without cache headers set (default: 7)af:[4,6],// Address family (default, both 4 and 6)includeZip:true|false,// Allow for zip codes in the final output (default: false)silent:true|false,// Don't log in console (default: false)keepNonIso:true|false,// Don't validate ISO codes (default: false)keepInvalidSubdivisions:true|false,// Don't validate ISO codes of the subdivisions (default: false)removeInvalidSubdivisions:true|false,// Remove invalid subdivisions but keep the rest of the geofeed if valid (default: false)skipSuballocations:true|false,// Skip fetching ARIN sub allocationstest:"ip/prefix",// Test specific ip/prefix using RDAPoutput:"result.csv",// Output file (default: "result.csv")downloadTimeout:5// Interrupt downloading a geofeed file after seconds (default: 10)};newGeofeedFinder(options)// The options dict is optional, you can just do new GeofeedFinder().getGeofeeds().then(geofeeds=>{// Do something with the geofeeds// An array of objects { prefix, country, region, city }});

About

Utility to find geofeed files linked from rpsl.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2026 Movatter.jp