smartdns 0.9.2-alpha.1

A cross platform local DNS server written in rust to obtain the fastest website IP for the best Internet experience, support DoT, DoQ, DoH, DoH3.
[package]
name = "smartdns"
version = "0.9.2-alpha.1"
authors = ["YISH <mokeyish@hotmail.com>"]
edition = "2021"
rust-version = "1.75.0"

keywords = ["DNS", "BIND", "dig", "SmartDNS", "Dnsmasq"]
categories = ["network-programming"]

description = """
A cross platform local DNS server written in rust to obtain the fastest website IP for the best Internet experience, support DoT, DoQ, DoH, DoH3.
"""

homepage = "https://github.com/mokeyish/smartdns-rs"
repository = "https://github.com/mokeyish/smartdns-rs"
license = "GPL-3.0-only"
readme = "README.md"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nightly)'] }

[package.metadata.patch]
# crates = ["hickory-server", "hickory-proto"]

[features]

default = ["resolve-cli", "dns-over-tls", "dns-over-https", "dns-over-quic", "dns-over-h3", "dnssec", "service", "nft", "nom-recipes-all", "self-update" ]

homebrew = ["resolve-cli", "dns-over-tls", "dns-over-https", "dns-over-quic", "dns-over-h3", "dnssec", "service", "nft", "nom-recipes-all" ]

nom-recipes-all =["nom-recipes-ip"]

nom-recipes-ip = ["nom-recipes-ipv4", "nom-recipes-ipv6"]
nom-recipes-ipv4 = []
nom-recipes-ipv6 = [
  "nom-recipes-ipv4" # support IPv4-mapped IPv6 addresses
] 

failed_tests = []
disable_icmp_ping = []
self-update = ["dep:self_update"]

resolve-cli = ["dep:console"]

dns-over-tls = []
dns-over-https = ["dns-over-https-rustls"]
dns-over-quic = [
  "hickory-proto/dns-over-quic",
  "hickory-resolver/dns-over-quic",
]
dns-over-h3 = [
  "hickory-proto/dns-over-h3",
  "hickory-resolver/dns-over-h3"
]

dns-over-https-rustls = [
  "hickory-proto/dns-over-https-rustls",
  "hickory-resolver/dns-over-https-rustls",
]

mdns = []

service = [
  "dep:which",
  "dep:self-replace", "dep:same-file" # windows self_delete
]

nft = ["dep:which", "dep:either"]

dnssec = [ "hickory-proto/dnssec-ring", "rustls/ring"]

experimental = ["experimental-trie", "experimental-phf"]

experimental-trie = []
experimental-phf = [
  "dep:boomphf"
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[patch.crates-io]
# rustls = { git = "https://github.com/mokeyish/rustls.git", branch = "patched_main"}
# hickory-resolver = { git = "https://github.com/hickory-dns/hickory-dns.git", rev = "41b6e33"}
# hickory-server = { path = "./target/patch/hickory-server-0.24.0" }
# hickory-proto = { path = "./target/patch/hickory-proto-0.24.0" }
# rustls-native-certs = { git = "https://github.com/mokeyish/rustls-native-certs.git" }
hostname = { git = "https://github.com/mokeyish/hostname.git", branch = "dev" }
# enum_dispatch = { git = "https://gitlab.com/mokeyish/enum_dispatch.git", branch = "master"}
# axum = { git = "https://github.com/tokio-rs/axum.git", rev = "8854e66" }
# boomphf ={ path = "./target/patch/boomphf-0.6.0"}
rustls-pki-types = { git = "https://github.com/mokeyish/pki-types.git", rev = "1.10.1.smartdns.1" }

[dependencies]
cfg-if = "1"
clap = { version = "4.5", features = ["derive"] }
clap-verbosity-flag = "2.2.2"
thiserror = "2.0"
anyhow = "1.0"
once_cell = "1.16.0"
nom = "7.1.3"
enum_dispatch = "0.3.13"
bytes = "1.6.0"
either = { version = "1.12.0", optional = true }


# api
axum = { version = "0.7.7" }
axum-server = { version = "0.7.1", features = ["tls-rustls-no-provider"] }

# serde
serde = { version = "1.0", features = ["derive"]}
serde_yaml = "0.9"
serde_json = "1.0"

# async/await
futures = { version = "0.3.5", default-features = false, features = ["std"] }
futures-intrusive = "0.5"
futures-util = { version = "0.3.5", default-features = false, features = ["std"] }
async-trait = "0.1.80"
tokio = { version = "1.41", features = [
  "time",
  "rt",
  "signal",
  "macros",
  "parking_lot",
] }
tokio-rustls = { version = "0.26.0", default-features = false }
tokio-util = "0.7.12"
socket2 = { version = "0.5", features = ["all"] }
reqwest = { version = "0.12", default-features = false, features = [
  "blocking",
  "rustls-tls",
] }

# log
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = [
  "std",
  "fmt",
  "env-filter",
] }
# tracing-appender = "0.2"

# hickory dns
hickory-proto = { git = "https://github.com/mokeyish/hickory-dns.git", rev = "0.25.0-smartdns.6", version = "0.25.0-alpha.4", features = ["serde"]}
hickory-resolver = { git = "https://github.com/mokeyish/hickory-dns.git", rev = "0.25.0-smartdns.6", version = "0.25.0-alpha.4", features = [
  "serde",
  "system-config",
] }
# hickory-server = { git = "https://github.com/mokeyish/hickory-dns.git", rev = "0.25.0-smartdns.5", version = "0.25.0-alpha.2", features = ["resolver"], optional = true }
quinn = { version = "0.11.2", default-features = false }

# ssl
webpki-roots = "0.26"
rustls = { version = "0.23", default-features = false, features = ["std", "tls12"]  }
rustls-pemfile = "2"
rustls-native-certs = "0.8"

lru = { version = "0.12", default-features = false }
# time = "0.3"
chrono = { version = "0.4.38", features = ["serde"]}
surge-ping = "0.8.1"
rand = "0.8.5"
smallvec = "1.13.2"
csv = "1.1"
hostname = "0.3"
byte-unit = { version = "5.0.3", features = ["serde"]}
ipnet = "2.7"
which = { version = "7.0.1", optional = true }
glob = "0.3.1"

# process
sysinfo = { version = "0.32", default-features = false, features = ["system"]}

# proxy
async-socks5 = { version = "0.6.0", git = "https://github.com/mokeyish/async-socks5.git", rev = "f78eec5" }
async-http-proxy = { version = "1.2.5", features = [
  "runtime-tokio",
  "basic-auth",
] }

num-traits = "0.2.19"
url = "2.5.4"
# regex = "1"
# rnp = "0.1"
boomphf = { version = "0.6.0", optional = true }
local-ip-address = "0.6.1"
console = { version = "0.15.8", optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
uzers = { version = "0.12", default-features = false }
caps = "0.5.5"
self_update = { version = "0.41.0", default-features = false, features=["archive-tar", "compression-flate2", "rustls"], optional = true }

[target.'cfg(target_os = "android")'.dependencies]
self_update = { version = "0.41.0", default-features = false, features=["archive-tar", "compression-flate2", "rustls"], optional = true }

[target.'cfg(target_os = "macos")'.dependencies]
self_update = { version = "0.41.0", default-features = false, features=["archive-zip", "compression-zip-deflate", "rustls"], optional = true }


[target.'cfg(windows)'.dependencies]
windows = { version = "0.58", features = [
  "Win32_System_Console",
  "Win32_Foundation",
  "Win32_Networking", "Win32_Networking_WinSock", "Win32_System_IO", # set UDP_CONNRESET off
] }
windows-service = "0.7.0"
self_update = { version = "0.41.0", default-features = false, features=["archive-zip", "compression-zip-deflate", "rustls"], optional = true }
self-replace = { version = "1.3.7", optional = true }
same-file = { version = "1", optional = true }



[build-dependencies]
reqwest = { version = "0.12", default-features = false, features = [
  "blocking",
  "rustls-tls",
] }
chrono = "0.4.38"
anyhow = "1.0"


[target.'cfg(target_os = "linux")'.build-dependencies]
cc = "1.2"
bindgen = "0.70"


# Dev-dependencies are not used when compiling a package for building, but are used for compiling tests, examples, and benchmarks.
[dev-dependencies]
reqwest = { version = "0.12", default-features = false, features = [
  "blocking",
  "rustls-tls",
] }


[profile.release]
# see: https://github.com/johnthagen/min-sized-rust
strip = true    # Automatically strip symbols from the binary.
opt-level = "z" # Optimize for size.
lto = true
codegen-units = 1