selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
D-NET logo

Self-host D-NET

v3.1.0

DDNS, CDN, port forwarding, reverse proxy, SSL management

ReleaseOpen SourceMIT
docker run -d --name dnet --net=host -v /opt/dnet:/root --restart=always cxbdasheng/dnet:latest
Updatedlast week
LanguageGo
Setup difficultyModerate
Stars
191
Port
9877 (Web management interface)
Docker
cxbdasheng/dnet

What is D-NET?

Should you self-host D-NET?

D-NET scores 47/100 on selfhost.directory (how scoring works) and ranks #20 of 31 in Networking. It has 191 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v3.1.0, came out on 16 September 2026. New versions land roughly every 6 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is headscale (82/100, 45 140 stars). It scores higher overall, so compare the two before you pick. See D-NET vs headscale side by side.

Features

  • ACME Automatic Certificate Renewal
  • Certificate Hot Reload
  • Dynamic CDN (DCDN)
  • Dynamic DNS (DDNS)
  • IPv4/IPv6 dual-stack
  • Online Speed Test
  • Per-Domain Authentication
  • Port Forwarding (DPF)
  • Reverse Proxy & Web Services (DWS)
  • SSL Certificate Management (DSSL)
  • System Service Installation
  • Webhook Notifications
  • Web management interface

D-NET README

How to install D-NET

Install D-NET with Docker

Environment variables
DNET_TRUSTED_PROXIES (for reverse proxy deployments)

Linux(推荐 Host 模式):

docker run -d --name dnet --net=host -v /opt/dnet:/root --restart=always cxbdasheng/dnet:latest

macOS / Windows(端口映射):

docker run -d --name dnet -p 9877:9877 -v /opt/dnet:/root --restart=always cxbdasheng/dnet:latest

Host network mode recommended on Linux for IPv6 detection. Port mapping mode works on macOS/Windows but may not detect host IPv6 addresses.

How to configure D-NET

  • -c~/.dnet_config.yamlCustom configuration file path

    Custom configuration file path

    values: e.g. /path/to/config.yaml

  • -dcdnCacheTimesForce CDN record sync every N sync cycles

    Force CDN record sync every N sync cycles

    values: e.g. 10

  • -ddnsCacheTimesForce DNS record sync every N sync cycles

    Force DNS record sync every N sync cycles

    values: e.g. 10

  • DNET_TRUSTED_PROXIESComma-separated list of trusted proxy IPs or CIDRs for X-Forwarded-For/X-Real-IP handling when behind a reverse proxy

    Comma-separated list of trusted proxy IPs or CIDRs for X-Forwarded-For/X-Real-IP handling when behind a reverse proxy

    values: e.g. 127.0.0.1,::1,10.0.0.2/32

  • -dnsCustom DNS server for resolution

    Custom DNS server for resolution

    values: e.g. 8.8.8.8

  • -fSync interval in seconds for DDNS/DCDN updates

    Sync interval in seconds for DDNS/DCDN updates

    values: e.g. 300

  • -l:9877Listen address for the web management interface

    Listen address for the web management interface

    values: e.g. :9877

  • -nowebDo not start the web management interface

    Do not start the web management interface

  • -resetPasswordReset the web interface password

    Reset the web interface password

    values: e.g. newpass

  • -skipVerifyfalseSkip HTTPS certificate verification for cloud provider APIs, webhooks, and public IP detection (default: false)

    Skip HTTPS certificate verification for cloud provider APIs, webhooks, and public IP detection (default: false)

  • -uUpgrade current D-NET version

    Upgrade current D-NET version

D-NET releases & version history

FAQ

UDP 转发已监听,但收不到响应?

Confirm the rule uses UDP, firewall and Docker mapping allow UDP, and test with the actual application (e.g., dig for DNS). Only upload traffic increasing doesn't mean the target responded.

记录更新频率太高,想减少 API 调用?

Increase the sync interval with -f (e.g., 300 seconds) and increase -ddnsCacheTimes to reduce forced sync frequency. Dynamic records skip updates when IP is unchanged, but periodic forced comparisons still occur.

CNAME 记录配置后其他记录消失了?

This is expected. CNAME records conflict with A/AAAA/TXT at the same subdomain; D-NET automatically removes conflicting records when adding a CNAME, and vice versa.

获取不到公网 IPv4 地址?

Home broadband typically has the router dialing, so the server sees a private IP. Use URL-based detection (e.g., https://4.ipw.cn) and verify the URL is reachable with curl.

获取不到 IPv6 地址?

Verify the system has a public IPv6 assigned (ip -6 addr). On Linux, use Docker host network mode to read host interfaces; bridge mode only sees container interfaces. URL-based detection requires the container to have IPv6 egress.

开启 Webhook 后会通知证书到期或代理故障吗?

No. Webhook notifications only trigger from DDNS/DCDN sync events. They do not cover DSSL renewal or DWS/DPF runtime failures. Check module status and logs for those.

证书申请或续期失败怎么办?

Check DSSL list errors and logs. For HTTP/TLS-ALPN validation, verify public ports 80/443 are reachable. For DNS validation, check API credentials, zone permissions, and TXT record propagation. Failed attempts retain the old certificate; retry after fixing.

DSSL 已申请证书,为什么管理界面仍是 HTTP?

DSSL certificates are for DWS to reference. The management UI and DWS entry points are separate; you must enable HTTPS in DWS configuration and select the certificate.

DWS 和 DPF 如何选择?

Use DWS for HTTP/HTTPS proxy, redirects, or speed testing by domain name. Use DPF for generic TCP/UDP forwarding. DWS can terminate TLS using DSSL certificates; DPF passes HTTPS through to the target.

DPF 能代替内网穿透吗?

No. DPF only forwards TCP/UDP ports when the client can reach the entry point and D-NET can reach the target. It does not provide NAT traversal or relay servers.

同步间隔设置多少合适?

For typical home broadband, 120-300 seconds is recommended; if IP changes are infrequent, 600 seconds can be used. See Best Practices for cache parameter tuning.

配置文件在哪里?

Default is ~/.dnet_config.yaml in the running user's home directory (e.g., /root/.dnet_config.yaml for root). Docker mounts at /opt/dnet:/root map to /opt/dnet/.dnet_config.yaml on the host. Use -c to specify a custom path.

如何查看运行日志?

On macOS use `log show --predicate 'process == "dnet"' --last 1h`; on Linux systemd use `journalctl -u dnet -f`; on Docker use `docker logs -f dnet`.

Web 界面无法访问怎么办?

Check if the service is running (systemctl, sc.exe, or docker ps), verify the address and port (default http://localhost:9877), check firewall rules, and review logs for errors.

忘记 Web 界面密码怎么办?

Run `./dnet -resetPassword 'newpassword'` for binary installs, or `docker exec dnet /app/dnet -resetPassword 'newpassword' && docker restart dnet` for Docker. Must use the same config file path if customized.

More in Reverse Proxy

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…