Skip to content

๐Ÿ”’ Hosts-only adaptation of StevenBlacks hosts files. Optimized for Fortinets FortiOS Fabric Connectors.

License

Notifications You must be signed in to change notification settings

cyb3rko/stevenblack-hosts-trimmed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

license Build Status last commit commit activity

StevenBlack Hosts Trimmed

This repo is based on the awesome hosts files by StevenBlack:
https://github.com/StevenBlack/hosts

The hosts files are optimized for usage in Fortinets FortiOS fabric connectors, as they have the following limitations:

  • support only for format without leading ip address
  • maximum of 131.072 entries per file
  • not supporting inline comments

The main unified hosts file as well as all alternate hosts file combinations are converted in the respective directories in alternates.

Modifications

A simple Python script optimizes the hosts files using the following actions:

Line Trimming

Converts the original format

0.0.0.0 ads.facebook.com
0.0.0.0 an.facebook.com
0.0.0.0 pixel.facebook.com

into the new format

ads.facebook.com
an.facebook.com
pixel.facebook.com

File Division

Divides files to have a maximum of 130.000 entries per file:

129.000 entries result in:

  • hosts0 (129.000)

131.000 entries result in:

  • hosts0 (130.000)
  • hosts1 (1.000)

Inline Comment Extraction

Moves inline comments like

ads.facebook.com # this domain is disturbing

to a new line

# this domain is disturbing
ads.facebook.com

About

๐Ÿ”’ Hosts-only adaptation of StevenBlacks hosts files. Optimized for Fortinets FortiOS Fabric Connectors.

Topics

Resources

License

Stars

Watchers

Forks

Languages