Home

Awesome

<picture> <source media="(prefers-color-scheme: dark)" srcset="assets/logo-white.png"> <source media="(prefers-color-scheme: light)" srcset="assets/logo-dark.png"> <img alt="a logo for iran sing-box rules in both dark and light mode" src="assets/logo-dark.png"> </picture> <p align="center"> <img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/Chocolate4U/Iran-sing-box-rules/release.yml?event=schedule&style=for-the-badge&logo=github&cacheSeconds=3600"> <img alt="GitHub release" src="https://img.shields.io/github/v/release/Chocolate4U/Iran-sing-box-rules?style=for-the-badge&cacheSeconds=3600"> <img alt="GitHub Release Date" src="https://img.shields.io/github/release-date/Chocolate4U/Iran-sing-box-rules?display_date=published_at&style=for-the-badge&cacheSeconds=3600"> <img alt="License" src="https://img.shields.io/github/license/Chocolate4U/Iran-sing-box-rules?style=for-the-badge&color=blue&cacheSeconds=3600"> </p>

فارسی

:writing_hand: Introduction

This is an Enhanced and All-in-One set of geo-location routing files optimized for Iranian users to use in sing-box and all its compatible clients.

:bulb: For V2Ray geolocation rules please refer to Iran V2Ray Rules
:bulb: For Clash geolocation rules please refer to Iran Clash Rules

:arrow_down: How to download

<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.simpleicons.org/github/white"><source media="(prefers-color-scheme: light)" srcset="https://cdn.simpleicons.org/github/dark"><img height="32" width="32" alt="github logo in dark and light mode." src="https://cdn.simpleicons.org/github/dark"></picture> From GitHub

Rule-Set

New Geo-Assets format introduced in sing-box v1.8.0+ in order to replace GeoIP and GeoSite.
For more information visit rule-set

See here for a list of all supported rule-set assets.

[!WARNING] GeoIP, GeoSite and all .db files in general are deprecated in sing-box v1.8.0+ and you should use Rule-Set instead. Only use .db assets if you are using sing-box v1.7.x and lower.

:bulb: Rule-Set assets are in these formats: geoip-xx.srs and geosite-xx.srs. Replace xx with your desired category. For example:

Rule-Set https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geoip-ir.srs
Rule-Set https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geosite-ir.srs

DB

GeoIP https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/geoip.db
GeoSite https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/geosite.db

GeoIP-Lite https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/geoip-lite.db
GeoSite-Lite https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/geosite-lite.db

Security-IP https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/security-ip.db
Security https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/security.db

<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.simpleicons.org/jsdelivr/white"><source media="(prefers-color-scheme: light)" srcset="https://cdn.simpleicons.org/jsdelivr/dark"><img height="32" width="32" alt="github logo in dark and light mode." src="https://cdn.simpleicons.org/jsdelivr/dark"></picture> From jsdelivr CDN

Rule-Set

Rule-Set https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@rule-set/geoip-ir.srs
Rule-Set https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@rule-set/geosite-ir.srs

DB

GeoIP https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@release/geoip.db
GeoSite https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@release/geosite.db

GeoIP-Lite https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@release/geoip-lite.db
GeoSite-Lite https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@release/geosite-lite.db

Security-IP https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@release/security-ip.db
Security https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@release/security.db

:computer: Usage

sing-box core

<details> <summary><strong>Using Rule-Set (Requires sing-box v1.8.0+)</strong></summary>

Add the following to your sing-box client configuration:

"outbounds": [
  {
    "type": "direct",
    "tag": "direct"
  },
  {
    "type": "block",
    "tag": "block"
  }
],
"route": {
    "rules": [
      {
        "ip_is_private": true,
        "outbound": "direct"
      },
      {
        "rule_set": [
          "geosite-category-ads-all",
          "geosite-malware",
          "geosite-phishing",
          "geosite-cryptominers",
          "geoip-malware",
          "geoip-phishing"
        ],
        "outbound": "block"
      },
      {
        "rule_set": [
          "geosite-ir",
          "geoip-ir"
        ],
        "outbound": "direct"
      }
    ],
    "rule_set": [
      {
        "tag": "geosite-ir",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geosite-ir.srs"
      },
      {
        "tag": "geosite-category-ads-all",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geosite-category-ads-all.srs"
      },
      {
        "tag": "geosite-malware",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geosite-malware.srs"
      },
      {
        "tag": "geosite-phishing",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geosite-phishing.srs"
      },
      {
        "tag": "geosite-cryptominers",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geosite-cryptominers.srs"
      },
      {
        "tag": "geoip-ir",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geoip-ir.srs"
      },
      {
        "tag": "geoip-malware",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geoip-malware.srs"
      },
      {
        "tag": "geoip-phishing",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/rule-set/geoip-phishing.srs"
      }
    ]
  },
  "experimental": {
    "cache_file": {
      "enabled": true
    }
  }
</details> <details> <summary><strong>Using DB Files</strong></summary>

Add the following to your sing-box client configuration:

"outbounds": [
  {
    "type": "direct",
    "tag": "direct"
  },
  {
    "type": "block",
    "tag": "block"
  }
],
"route": {
  "geoip": {
      "download_url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/geoip.db"
  },
  "geosite": {
    "download_url": "https://raw.githubusercontent.com/Chocolate4U/Iran-sing-box-rules/release/geosite.db"
  },
  "rules": [
    {
      "geosite": [
        "category-ads-all",
        "malware",
        "phishing",
        "cryptominers"
      ],
      "outbound": "block"
    },
    {
      "geoip": [
        "malware",
        "phishing"
      ],
      "outbound": "block"
    },
    {
      "geosite": "ir",
      "outbound": "direct"
    },
    {
      "geoip": [
        "ir",
        "private"
      ],
      "outbound": "direct"
    }
  ]
}
</details>

:page_with_curl: Categories

GeoIP

<details> <summary><strong>Categories in <code>geoip.db</code></strong></summary> </details> <details> <summary><strong>Categories in <code>geoip-lite.db</code></strong></summary> </details> <details> <summary><strong>Categories in <code>security-ip.db</code></strong></summary> </details> <details> <summary><strong>Categories in <code>geoip-services.db</code></strong></summary> </details>

GeoSite

<details> <summary><strong>Categories in <code>geosite.db</code></strong></summary> </details> <details> <summary><strong>Categories in <code>geosite-lite.db</code></strong></summary> </details> <details> <summary><strong>Categories in <code>security.db</code></strong></summary> </details>

:information_desk_person: How is this made?

geoip.db,geoip-lite.db are generated using source code from my fork of sing-geoip. It uses Country.mmdb,Country-lite.mmdb from Iran V2Ray Rules to generate geoip.db,geoip-lite.db.
geosite.db,geosite-lite.db are generated using source code from my fork of sing-geosite. It uses geosite.dat,geosite-lite.dat from Iran V2Ray Rules to generate geosite.db,geosite-lite.db.

:handshake: Contribution

All contributions are welcome and appreciated. You can contribute to this project in 2 ways:

  1. Contribute to its upstream sources
    Do you know a Domain that should be bypassed? report it to Iran Hosted Domains
    Do you know a Persian advertisement domain that should be blocked or a false positive? report it to PersianBlocker
    Do you know... OK, you got the idea!
  2. Contribute directly to this project
    Report issues, open pull requests, suggest new sources or categories or any idea, in general, to make this repository more useful for everyone.

:raising_hand_man: Also one more thing, if this repository was useful to you, kindly leave a :star: up there so this project can be seen by more people.

:copyright: License

This project, except for upstream sources, is licensed under the GNU GPLv3 License - see the LICENSE file for details.

All rights are reserved for All upstream sources used in this project according to their respective licenses. Please refer to Sources section for more details.

:package: Sources

GeoIP

SourceMaintainerHome PageLicenseCategory
GeoLite2MaxMindHome PageCC BY-SA 4.0Country IPs
IP2Location LITEIP2LocationHome PageCC BY-SA 4.0Country IPs
ITO GOVITO GOVHome PageN/Air(messenger IPs)
V2ray-rules-datLoyalsoldierHome PageGPL-3.0cn
Arvan CloudArvan CloudHome PageAll rights reservedarvancloud
Derak CloudDerak CloudHome PageAll rights reservedderakcloud
IranServerIranServerHome PageAll rights reservediranserver
ParsPackParsPackHome PageAll rights reservedparspack
CloudflareCloudflareHome PageAll rights reservedcloudflare
TelegramTelegramHome PageAll rights reservedTelegram
URLhausabuse.chHome PageCC0malware
Phishing URL Blocklistmalware-filter GroupHome PageMITphishing
IPRangeslord-alfredHome PageCC0 1.0everything else

GeoSite

SourceMaintainerHome PageLicenseCategory
Iran Hosted DomainsbootmortisHome PageMITir
PersianBlockerMasterKiaHome PageAGPL-3.0ads
DNS BlocklistsHageziHome PageAll rights reservedads
Ad and tracking server listPeter LoweHome PageMcRae GPLads
GoodbyeAdsjerryn70Home PageMITads
AdGuard DNS filterAdguard TeamHome PageGPL-3.0ads
URLhausabuse.chHome PageCC0malware
Phishing URL Blocklistmalware-filter GroupHome PageMITphishing
NoCoin adblock listhoshsadiqHome PageMITcryptominers
Unified HostsStevenBlackHome PageMITsocial, nsfw
Domain list communityDomain list communityHome PageMITeverything else

:warning: Disclaimer

This repository is not affiliated, associated, authorized, endorsed by, or in any way officially connected to any of the aforementioned resources, websites, services, or any entity to which this may concern, in any way.
The data in this repository is gathered from publicly available resources and is provided as-is, intended for informational purposes only with no guarantee of accuracy, liability or availability We are not responsible for any harm or damage that may arise from using the data in this repository. Please do your research before using any data from this repository.

:pray: Special Thanks