Skip to content

"Iran Hosted Domains" is a comprehensive list of Iranian domains and services that are hosted within the country.

License

Notifications You must be signed in to change notification settings

mmrabbani/iran-hosted-domains

 
 

Repository files navigation

Iran Hosted Domains

Note

🚨 For safety reasons, it may be advisable to use a separate, non-personal account for your Github activity.

🚨 Ensure that your personal email address is not visible when you push commits to Github. More info

A lot of services and domains are outside of Iran and they are restricted or blocked, for accessing this service you need to use VPN or proxies with tunneling option, apart from these problems, when we use proxies the domestic services are unavailable because our IP is not in Iran; for bypassing these issues we gathered a list of Iranian domains and services to help our people bypass this situation.

Disclaimer

This repository is a compiled list of public information about websites hosted in Iran. It is intended for informational purposes only and is not intended to provide guidance on how to connect to or create or manage a virtual private network (VPN). The content in this repository is provided as-is and we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability of the information contained in this repository. Any reliance you place on such information is strictly at your own risk. We will not be liable for any errors or omissions in the information or for any losses, damages, or other liabilities that may arise from its use. Please use caution and consult with a qualified professional before using any information from this repository.

Usage

This can differ depending on which tool you use. You can download the domains list from the release page. In v2ray clients you can set Domain Resolution Strategy to IPIfNonMatch for better routing. more info.

In the release section, you'll find the qv2ray_schema file.

  1. Download the file.
  2. open preferences and click on Advanced Route Settings.
  3. From the bottom of the screen, click on import schema....
  4. choose the downloaded file (qv2ray_schema.json).
  5. in the opened dialogue box, click on yes.
  6. Click on OK.

.dat file

It can be used in all v2fly, v2ray and xray clients.

  1. Download iran.dat file from here.

  2. Copy/Import file in your client. for example:

    • v2ray macOS: /usr/local/share/v2ray
  3. Add proper rules:

    • ext:iran.dat:ir in bypass section
    • ext:iran.dat:other in bypass section
    • ext:iran.dat:ads in block section
  4. Reconnect.

  1. Download iran.dat file from here.

  2. Import .dat file from Route -> Three dots -> Manage Route Assets:

  3. Add proper rules Route -> Create Route:

    • Block Ads:
      • domain: geosite:category-ads-all
      • outbound: Block
    • Block Iran Ads:
      • domain: ext:iran.dat:ads
      • outbound: Block
    • Bypass Iran .ir Domains:
      • domain: regexp:.+\.ir$
      • outbound: Bypass
    • Bypass Iran non .ir Domains:
      • domain: ext:iran.dat:other
      • outbound: Bypass
    • Bypass Iran geoip:
      • ip: geoip:ir
      • outbound: Bypass

for screenshots of routing settings click here.

  1. Reconnect.
  1. Download shadowrocket.conf file.
  2. Tap Import From Cloud in the Shadowrocket app and then import the file.
  3. Finally, tap on the shadowrocket.conf and select Use Config.
  1. Make sure you are using at least version 2023.04.13 of Clash Premium Core Or v1.14.1 of Clash.Meta Core. If not, you can use the old version format described in the third step.
  2. Open your current profile/config that you use.
  3. Add these lines to the file:
rule-providers:
  iran:
    type: http
    format: text
    behavior: domain
    url: "https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/clash_rules.txt"
    path: ./ruleset/iran.txt
    interval: 432000

⚠️ Note: If you are using older versions add these instead :

rule-providers:
  iran:
    type: http
    behavior: domain
    url: "https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/clash_rules.yaml"
    path: ./ruleset/iran.yaml
    interval: 432000
  1. Add these lines to rules: section
  - RULE-SET,iran,DIRECT
  - GEOIP,IR,DIRECT
  1. Save the file.
  2. Based on the client, you may need to set clash on Rule mode.
  1. Open your current profile/config that you use.
  2. Add these lines to [Rule] section
DOMAIN-SET,https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/surge_domainset.txt,DIRECT,update-interval=432000
GEOIP,IR,DIRECT

Surfboard ignore update-interval at this moment, consider updating from Tool>External resources

⚠️ Note: If you are using older Surge versions (before Surge for Mac v3.5.1/Surge for iOS v4.2.2) add these instead:

RULE-SET,https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/surge_ruleset.txt,DIRECT,update-interval=432000
GEOIP,IR,DIRECT
  1. Save the file.
  2. Set 'Outbound Mode' to 'Rule-based'.

⚠️ Note : in case that blocked websites are not working with 'Rule-based' mode, consider adding this rule before 'FINAL' rule:

DOMAIN-KEYWORD,,YourFinalProxy/ProxyGroup,force-remote-dns

Use your own Proxy/ProxyGroup instead of 'YourFinalProxy/ProxyGroup')

🚨 You can also use Surge's Rule-Set or Domain-Set in Loon / LanceX.

📽️ Video tutorial

  1. First download iran.dat from here.
  2. From the menu, go to the Geo asset files section, press + from the top, and select the iran.dat file.
  3. From the menu, go to Settings and make sure Domain Strategy is set to IpIfNonMatch.
  4. Go to the Custom rules section in Settings.
  • In the DIRECT URL OR IP tab, write ext:iran.dat:ir,ext:iran.dat:other,geoip:ir, then press 🗸 from the top.
  • In the BLOCKED URL OR IP tab, write ext:iran.dat:ads and then press 🗸 from the top again.
  1. Hit back, and that's it.

For blocking local domains and IPs in the server side follow this instructions. It's only available in Persian.

  1. Download the domains.txt file from release section.
  2. Open Program in the man page of nekoray.
  3. Open preferences and click on Routing Setting.
  4. Paste domains.txt file on domain-direct section.
  5. Press OK button and restart the app.
  1. Download iran.dat file from here and place in v2rayN directory and inside bin folder.
  2. Open v2ray and select Settings and then select RoutingSetting
  3. In the new window click on Advanced Function and choose Add
  4. In the new window, in Remarks field choose any name and in the Rule List empty area right-click and select Rule Add
  5. In the new window choose direct for outboundTag and the domain section type ext:iran.dat:ir,ext:iran.dat:other,regexp:^.+\.ir$
  6. Click on Confirm until you reach the main app window
  7. Make sure that your rule is selected from the bottom of the page. If not choose it from the drop down menu.
  1. Download iran-geosite.db file from here and place it in the sing-box working directory.
  2. Open the sing-box config file and edit the Route section in this format
{
  "route": {
    "geosite": {
      "path": "iran-geosite.db",
      "download_url": "https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran-geosite.db"
    },
    "rules": [
      {
        "geosite": "ir",
        "outbound": "direct"
      },
      {
        "geosite": "other",
        "outbound": "direct"
      },
      {
        "geosite": "ads",
        "outbound": "block"
      },
      {
        "domain_suffix": [
          ".ir"
        ],
        "outbound": "direct"
      }
    ]
  }
}
  1. For more information about the sing-box config template see here.

Create .dat file manually (Tutorial)

1. Install golang

It's important to install the right version. Always check it from v2fly/domain-list-community.

git clone https://github.com/v2fly/domain-list-community

3. Prepare domains

In a .dat file, you can have as many distinct groups as you want. Each of these groups can be in bypass, proxy or blocked sections. Each group can have as many domains as you want.

Each group is a txt file containing domains. For example, you can have an ads.txt file containing ad domains.

4. Move files to /data

When cloning domain-list-community, you also clone all the groups that have been there before. Since you don't need them, delete everything in /data directory.

Now you have to copy your files to /data directory. Make sure to remove their file extension. So for example, ads.txt needs to be ads.

cd domain-list-community
rm data/*

cp ~/ads.txt data/ads

5. Run the program

go run ./ --outputdir=../

Files

  • iran.dat: Contains all websites hosted in Iran and ADs in a special format.
  • domains.txt: Contains all websites hosted in Iran.
  • qv2ray_schema.json: Importable json schema that can be used in Qv2ray.
  • shadowrocket.conf: Importable conf file that can be used in Shadowrocket.

Sources & Acknowledgements

If you know of any other source, or you found a website that isn't here, please open an issue or add that specific website to custom_domains.py and make a PR.

How does it work?

A Python script is executed by Github Action and generates files that are on the release page.

About

"Iran Hosted Domains" is a comprehensive list of Iranian domains and services that are hosted within the country.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 100.0%