Skip to content

matveynator/chicha-whois

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chicha-whois

chicha-whois is a tiny but powerful CLI tool for working with the RIPE database and generating DNS ACLs. Clean, simple, and gets the job done. Written in Golang.

Downloads

Pick your binary and get started:

Need something else? Check all binaries.


Installation

On Linux AMD64, install in one line:

sudo curl -L https://files.zabiyaka.net/chicha-whois/latest/no-gui/linux/amd64/chicha-whois -o /usr/local/bin/chicha-whois && sudo chmod +x /usr/local/bin/chicha-whois

Done? Try it:

chicha-whois -h

Commands

  • -u: Update the RIPE database.
  • -dns-acl COUNTRYCODE: Generate a BIND ACL (e.g., RU).
  • -dns-acl-f COUNTRYCODE: Create a filtered ACL (no redundant subnets).
  • -l: Show available country codes.
  • -h: Show help.

Examples

  1. Update the RIPE database

    chicha-whois -u

    This downloads and updates the database locally.

  2. Create an ACL for Russia

    chicha-whois -dns-acl RU

    Outputs acl_RU.conf with all Russian IP ranges.

  3. Optimized ACL

    chicha-whois -dns-acl-f RU

    Same as above, but smarter—filters out redundant subnets.

  4. List all country codes

    chicha-whois -l

Notes

  • Database saved to: ~/.ripe.db.cache/ripe.db.inetnum.
  • ACL files saved to: Your home directory (e.g., ~/acl_RU.conf).

BIND9 Configuration for RU and UA Clients

Copy and paste the following configuration into your BIND9 named.conf:

include "/etc/bind/acl_RU.conf";
include "/etc/bind/acl_UA.conf";

view "Russia" {
    match-clients { RU; };  # RU clients
    zone "domain.com" {
        type master;
        file "/etc/bind/zones/db.domain.com.RU";
    };
};

view "Ukraine" {
    match-clients { UA; };  # UA clients
    zone "domain.com" {
        type master;
        file "/etc/bind/zones/db.domain.com.UA";
    };
};

view "default" {
    match-clients { any; };  # All other clients
    zone "domain.com" {
        type master;
        file "/etc/bind/zones/db.domain.com.default";
    };
};

Save ACLs to /etc/bind/acl_RU.conf and /etc/bind/acl_UA.conf.

Create zone files:

/etc/bind/zones/db.domain.com.RU
/etc/bind/zones/db.domain.com.UA
/etc/bind/zones/db.domain.com.default

Verify configuration:

sudo named-checkconf
sudo named-checkzone domain.com /etc/bind/zones/db.domain.com.ru

Restart BIND:

sudo systemctl restart bind9

Done!