Giter VIP home page Giter VIP logo

easyrpz's Introduction

EasyRPZ - Hosts to RPZ converter

EasyRPZ is a command-line tool written in Go for converting a list of domain names and IP addresses into a Response Policy Zone (RPZ) file format. It allows you to create an RPZ file that can be used for DNS filtering and blocking specific domains.

Usage

easyrpz \
  -i inputFile1.hosts \
  -i http://example.com/inputFile2.hosts \
  -e excludeFile1.txt \
  -e http://example.com/excludeFile2.txt \
  -o outputFile.rpz

This command will convert the input hosts files inputFile1.hosts and inputFile2.hosts (retrieved from the URL http://example.com/inputFile2.hosts), exclude the domains listed in excludeFile1.txt and excludeFile2.txt (retrieved from the URLs http://example.com/excludeFile2.txt), and generate the RPZ file outputFile.rpz.

Flags

  • -i: Input file paths or URLs (required, can be specified multiple times)
  • -o: Output file path (required)
  • -e: File paths or URLs containing domains to exclude (optional, can be specified multiple times)
  • -w: Include wildcard blocking

Installation

EasyRPZ is available as a prebuilt binary. You can download and place it in the /usr/local/bin folder, run the following command:

sudo wget -O /usr/local/bin/easyrpz \
  https://github.com/pure-dns/easyrpz/raw/main/easyrpz
sudo chmod +x /usr/local/bin/easyrpz

Uninstall

To remove the easyrpz binary, simply run the following command:

sudo rm /usr/local/bin/easyrpz

Features

  • Converts a list of domain names and IP addresses into RPZ format.
  • Excludes specific domains using exclude files.
  • Handles duplicate hosts by stripping duplicates.
  • Generates RPZ file header with the current date.

Development

You will need Go (version 1.16 or above).

Run the following command to build the program:

./make

After the build is successful, you will have an executable file named easyrpz in the current directory.

RPZ Header

The generated RPZ file starts with a header section. The header includes the following information:

  • Serial: Current date in the format YYYYMMDD.
  • Refresh: 2 weeks (default value).
  • Retry: 2 weeks (default value).
  • Expiry: 2 weeks (default value).
  • Minimum: 2 weeks (default value).
  • NS: NS record pointing to localhost.

License

This project is licensed under the MIT License. See the LICENSE file for details.

easyrpz's People

Contributors

fransallen avatar jeffscrum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.