Skip to content

Instantly share code, notes, and snippets.

@zekesonxx
Last active April 27, 2022 07:49
Show Gist options
  • Save zekesonxx/4652f074a09c3dd164076f7c5f9dd45f to your computer and use it in GitHub Desktop.
Save zekesonxx/4652f074a09c3dd164076f7c5f9dd45f to your computer and use it in GitHub Desktop.
/etc/whois.conf configuration line for AMPR IPs
# AMPR whois regex, post 44.192.0.0/10 sale
# AMPR space: 44.0.0.0/9, 44.128.0.0/10 (the first three fourths of 44.0.0.0/8)
# Third and forth octet matching regex credit to
# https://stackoverflow.com/questions/5284147/validating-ipv4-addresses-with-regexp
#
# Regex explanation:
# /-> First octet, always 44
# | /-> One and two digit second octets (0-99)
# | | /-> Three digit second octets, from 100-189
# | | | /-> Second octet 190 and 191
# | | | | (192+ was sold to Amazon)
# | | | |
# | | | | /-> /-> Third and fourth octets
^44\.([0-9]{1,2}|1[0-8][0-9]{1}|19[01])\.(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])\.(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])$ whois.ampr.org
# or, a version without the explanation to copy into your whois.conf:
# AMPR whois regex, post 44.192.0.0/10 sale
# AMPR space: 44.0.0.0/9, 44.128.0.0/10 (the first three fourths of 44.0.0.0/8)
^44\.([0-9]{1,2}|1[0-8][0-9]{1}|19[01])\.(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])\.(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])$ whois.ampr.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment