{"id":20536053,"url":"https://github.com/techprober/mosdns-lxc-deploy","last_synced_at":"2025-08-20T04:31:42.382Z","repository":{"id":60165406,"uuid":"528812901","full_name":"techprober/mosdns-lxc-deploy","owner":"techprober","description":"A generic guide to deploy mosdns in Proxmox LXC Container. [maintainers=@piyoki]","archived":false,"fork":false,"pushed_at":"2024-08-27T18:54:47.000Z","size":5264,"stargazers_count":49,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-11T00:11:41.182Z","etag":null,"topics":["dns-server","lxc","mosdns","proxmox"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techprober.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-25T11:05:37.000Z","updated_at":"2024-12-02T21:16:14.000Z","dependencies_parsed_at":"2024-01-04T04:22:42.319Z","dependency_job_id":null,"html_url":"https://github.com/techprober/mosdns-lxc-deploy","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techprober%2Fmosdns-lxc-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techprober%2Fmosdns-lxc-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techprober%2Fmosdns-lxc-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techprober%2Fmosdns-lxc-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techprober","download_url":"https://codeload.github.com/techprober/mosdns-lxc-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230394228,"owners_count":18218707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns-server","lxc","mosdns","proxmox"],"created_at":"2024-11-16T00:35:12.235Z","updated_at":"2024-12-19T07:05:56.710Z","avatar_url":"https://github.com/techprober.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003emosdns-lxc-deploy\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eA generic guide to deploy mosdns in Proxmox LXC Container\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://custom-icon-badges.herokuapp.com/github/license/techprober/mosdns-opnsense-install?logo=law\u0026color=critical\" alt=\"License\"/\u003e\n    \u003cimg src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FTechProber%2Fmosdns-lxc-deploy\u0026count_bg=%235322B2\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false\"/\u003e\n      \u003cimg src=\"https://custom-icon-badges.herokuapp.com/github/v/release/IrineSistiana/mosdns?logo=rocket\" alt=\"version\"\u003e\n    \u003cimg src=\"https://custom-icon-badges.herokuapp.com/github/issues-pr-closed/TechProber/mosdns-lxc-deploy?color=purple\u0026logo=git-pull-request\u0026logoColor=white\"/\u003e\n    \u003cimg src=\"https://custom-icon-badges.herokuapp.com/github/last-commit/TechProber/mosdns-lxc-deploy?logo=history\u0026logoColor=white\" alt=\"lastcommit\"/\u003e\n\u003c/p\u003e\n\n## Project Owner\n\nCopyRight 2021-2023 @TechProber. All rights reserved.\n\nMaintainer: [ Kev (@piyoki) ](https://github.com/piyoki)\n\n## Related Projects\n\n- [IrineSistiana/mosdns](https://github.com/IrineSistiana/mosdns) - A self-hosted DNS resolver\n- [tteck/Proxmox](https://github.com/tteck/Proxmox) - Proxmox Helper Scripts\n- [Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat) - Enhanced edition of V2Ray rules dat files, compatible with Xray-core, Shadowsocks-windows, Trojan-Go and leaf.\n- [Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip) - Enhanced edition of GeoIP files for V2Ray, Xray-core, Trojan-Go, Clash and Leaf, with replaced CN IPv4 CIDR available from ipip.net, appended CIDR lists and more.\n\n## Table of contents\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Documentation](#documentation)\n* [How to Use](#how-to-use)\n    * [Preparation](#preparation)\n    * [Download Binary](#download-binary)\n    * [Download Rules](#download-rules)\n    * [Reset Port 53](#reset-port-53)\n    * [Update Configuration](#update-configuration)\n    * [Run as Systemd Service](#run-as-systemd-service)\n* [CN Users](#cn-users)\n* [Appendix](#appendix)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Documentation\n\nMosdns Official Wiki: https://irine-sistiana.gitbook.io/mosdns-wiki/\n\nKnow DNS Providers: https://adguard-dns.io/kb/general/dns-providers/\n\n## How to Use\n\n### Preparation\n\nCreate a new directory for mosdns\n\n```bash\nmkdir -p /etc/mosdns\n```\n\nCreate sub directories\n\n```bash\nsudo mkdir -p /etc/mosdns/{ips,domains,downloads,custom,scripts}\nsudo touch /etc/mosdns/cache.dump\n```\n\nMake sure you have the following file structure present on your host:\n\n```\n# /etc/mosdns\n./\n|-- cache.dump\n|-- config.yml\n|-- custom\n|-- domains\n|-- downloads\n|-- scripts\n`-- ips\n\n5 directories, 2 files\n```\n\n\u003e [!NOTE]\n\u003e There is a dedicated `bootstrap playbook` to automate this, [check it out](./playbooks/auto-artifact-export.yml).\n\n### Download Binary\n\nDownload the latest mosdns binary from the [GitHub Release](https://github.com/IrineSistiana/mosdns/releases) Page\n\n```bash\nMOSDNS_PATH=/etc/mosdns\ncurl -o $MOSDNS_PATH/downloads/mosdns.zip https://github.com/IrineSistiana/mosdns/releases/download/{VERSION}/mosdns-{PLATFORM}-{ARCH}.zip\n# e.g\n# wget https://github.com/IrineSistiana/mosdns/releases/download/v5.1.3/mosdns-linux-amd64.zip\nunzip $MOSDNS_PATH/downloads/mosdns.zip\nsudo install -Dm755 $MOSDNS_PATH/downloads/mosdns /usr/bin\n```\n\n### Download Rules\n\nAvailable Rules - \u003chttps://github.com/techprober/v2ray-rules-dat/releases\u003e\n\nDownload and unzip the `geoip.zip` and `geosite.zip` files to `./ips/` and `./domains` respectively.\n\n```bash\nMOSDNS_PATH=/etc/mosdns\ncurl --progress-bar -JL -o $MOSDNS_PATH/downloads/geoip.zip https://github.com/techprober/v2ray-rules-dat/raw/release/geoip.zip\ncurl --progress-bar -JL -o $MOSDNS_PATH/downloads/geosite.zip https://github.com/techprober/v2ray-rules-dat/raw/release/geosite.zip\nunzip -o $MOSDNS_PATH/downloads/geoip.zip -d $MOSDNS_PATH/ips\nunzip -o $MOSDNS_PATH/downloads/geosite.zip -d $MOSDNS_PATH/domains\n```\n\n\u003e [!NOTE]\n\u003e Alternatively, you may use a dedicated script to automatically download and extract the geodata artifacts. See [./scripts/geodata-update.sh](https://github.com/techprober/mosdns-lxc-deploy/blob/master/scripts/geodata-update.sh)\n\n```bash\ncurl -L -o /usr/local/etc/mosdns/scripts/geodata-update.sh https://github.com/techprober/mosdns-lxc-deploy/raw/master/scripts/geodata-update.sh\n```\n\n### Reset Port 53\n\n```bash\nmkdir -p /etc/systemd/resolved.conf.d\n\n# /etc/systemd/resolved.conf.d/mosdns.conf\n[Resolve]\nDNS=127.0.0.1\nDNSStubListener=no\n```\n\nSpecifying `127.0.0.1` as DNS server address is necessary because otherwise the nameserver will be `127.0.0.53` which doesn’t work without DNSStubListener.\n\nActivate another resolv.conf file:\n\n```bash\nsudo mv /etc/resolv.conf /etc/resolv.conf.backup\nsudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf\n```\n\nRestart DNSStubListener:\n\n```bash\nsystemctl daemon-reload\nsystemctl restart systemd-resolved\n```\n\n### Update Configuration\n\n\u003e [!WARNING]\n\u003e Please take a look at the content of `config-{VERSION}.yml` before you copy it to `/etc/mosdns`. It is a boilerplate template which intends to provide users a reference to start with customizing their own config.\n\nGet the latest config file, namely `config-{VERSION}.yml`, from `./mosdns` folder in this repository, copy it to `/etc/mosdns`, and update params to fit your need.\n\n### Run as Systemd Service\n\n```bash\nsudo tee /etc/systemd/system/mosdns.service \u003c\u003cEOF\n[Unit]\nDescription=A DNS forwarder\nConditionFileIsExecutable=/usr/bin/mosdns\n\n[Service]\nWorkingDirectory=/etc/mosdns\nType=simple\nUser=root\nStartLimitInterval=5\nStartLimitBurst=10\nExecStart=/usr/bin/mosdns start -c config.yml\nRestart=abnormal\nRestartSec=120\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\nsudo systemctl daemon-reload\nsudo systemctl enable mosdns --now\n```\n\n## CN Users\n\nTo enhance the ad-free feature, we've added additional `AdBlockList` to our self-managed `geoip.dat` and `geosite.dat`\n\nPlease check out more details in [TechProber/v2ray-rules-dat](https://github.com/TechProber/v2ray-rules-dat).\n\n## Appendix\n\n- Auto generate `geoip.txt`, `geosites.txt` (since `*.dat` are deprecated in v5) - https://github.com/techprober/v2dat\n\n- CI (automate `*.txt export`) - https://github.com/techprober/v2ray-rules-dat/blob/master/.github/workflows/run.yml\n\n- Available Rules - https://github.com/techprober/v2ray-rules-dat/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechprober%2Fmosdns-lxc-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechprober%2Fmosdns-lxc-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechprober%2Fmosdns-lxc-deploy/lists"}