Skip to content

Commit 75b3570

Browse files
authored
Merge pull request #2208 from nickberardi/feat/nextdns-lxc
feat: add NextDNS
2 parents 02a109c + 214c7e6 commit 75b3570

3 files changed

Lines changed: 167 additions & 0 deletions

File tree

‎ct/nextdns.sh‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
# Engine comes from community-scripts/core; this repo only ships the scripts.
3+
# A local core checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core),
4+
# so a fork or branch of core can be tested without editing this file.
5+
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
6+
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
7+
# Copyright (c) 2021-2026 community-scripts ORG
8+
# Author: Nick Berardi (nberardi)
9+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
10+
# Source: https://nextdns.io | https://github.com/nextdns/nextdns
11+
12+
APP="NextDNS"
13+
var_tags="${var_tags:-dns;adblock;network}"
14+
var_cpu="${var_cpu:-1}"
15+
var_ram="${var_ram:-512}"
16+
var_disk="${var_disk:-2}"
17+
var_os="${var_os:-debian}"
18+
var_version="${var_version:-13}"
19+
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
20+
var_unprivileged="${var_unprivileged:-1}"
21+
export var_nextdns_profile="${var_nextdns_profile:-}"
22+
23+
header_info "$APP"
24+
variables
25+
color
26+
catch_errors
27+
28+
function update_script() {
29+
header_info
30+
check_container_storage
31+
check_container_resources
32+
33+
if [[ ! -x /usr/bin/nextdns ]]; then
34+
msg_error "No ${APP} Installation Found!"
35+
exit
36+
fi
37+
38+
msg_info "Updating ${APP}"
39+
$STD apt update
40+
$STD apt install -y nextdns
41+
msg_ok "Updated ${APP}"
42+
msg_ok "Updated successfully!"
43+
exit
44+
}
45+
46+
start
47+
build_container
48+
description
49+
50+
msg_ok "Completed Successfully!\n"
51+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
52+
echo -e "${INFO}${YW}NextDNS is configured and serving DNS on:${CL}"
53+
echo -e "${GATEWAY}${BGN}${IP}:53${CL} ${YW}(TCP/UDP)${CL}"
54+
echo -e "${INFO}${YW}Profiles are managed at: https://my.nextdns.io${CL}"
55+
echo -e "${INFO}${YW}Point DHCP clients or your router upstream DNS at the container IP.${CL}"

‎install/nextdns-install.sh‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: Nick Berardi (nberardi)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://nextdns.io | https://github.com/nextdns/nextdns
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
setup_deb822_repo \
17+
"nextdns" \
18+
"https://repo.nextdns.io/nextdns.gpg" \
19+
"https://repo.nextdns.io/deb" \
20+
"stable" \
21+
"main"
22+
23+
msg_info "Installing NextDNS"
24+
$STD apt install -y nextdns
25+
msg_ok "Installed NextDNS"
26+
27+
if [[ -z "${var_nextdns_profile:-}" ]]; then
28+
echo -e "${INFO}${YW}Get your profile ID from: https://my.nextdns.io${CL}"
29+
read -r -p "${TAB3}NextDNS Profile ID: " var_nextdns_profile
30+
fi
31+
var_nextdns_profile="${var_nextdns_profile//[[:space:]]/}"
32+
if [[ -z "${var_nextdns_profile}" ]]; then
33+
msg_error "NextDNS Profile ID is required (set var_nextdns_profile or enter it when prompted)"
34+
exit 1
35+
fi
36+
37+
msg_info "Configuring NextDNS"
38+
nextdns install \
39+
-profile "${var_nextdns_profile}" \
40+
-report-client-info \
41+
-setup-router
42+
msg_ok "Configured NextDNS (profile ${var_nextdns_profile})"
43+
44+
motd_ssh
45+
customize
46+
cleanup_lxc

‎json/nextdns.json‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"name": "NextDNS",
3+
"slug": "nextdns",
4+
"categories": [
5+
5
6+
],
7+
"date_created": "2026-08-23",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": null,
12+
"documentation": "https://github.com/nextdns/nextdns/wiki",
13+
"website": "https://nextdns.io/",
14+
"repository": "https://github.com/nextdns/nextdns",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/nextdns.webp",
16+
"description": "NextDNS is a DNS-over-HTTPS (DoH) client and resolver that blocks ads, trackers and malware using cloud-managed profiles. This script installs a minimal Debian LXC with the official NextDNS CLI from the NextDNS apt repository, prompts for your profile ID, and configures router mode so DNS is served on TCP/UDP port 53.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/nextdns.sh",
21+
"config_path": "/etc/nextdns.conf",
22+
"resources": {
23+
"cpu": 1,
24+
"ram": 512,
25+
"hdd": 2,
26+
"os": "Debian",
27+
"version": "13"
28+
}
29+
}
30+
],
31+
"default_credentials": {
32+
"username": null,
33+
"password": null
34+
},
35+
"app_vars": [
36+
{
37+
"name": "var_nextdns_profile",
38+
"label": "NextDNS Profile ID",
39+
"type": "text",
40+
"required": true,
41+
"help": "From https://my.nextdns.io — used with nextdns install -profile … -report-client-info -setup-router"
42+
}
43+
],
44+
"notes": [
45+
{
46+
"text": "During install you will be asked for your NextDNS profile ID (or pass var_nextdns_profile). The script runs: nextdns install -profile <id> -report-client-info -setup-router",
47+
"type": "info"
48+
},
49+
{
50+
"text": "Create or copy your profile ID from https://my.nextdns.io before running the script.",
51+
"type": "info"
52+
},
53+
{
54+
"text": "After install, NextDNS listens on TCP/UDP port 53. Point DHCP clients at the container IP:53, or set the container as upstream DNS on your router. There is no local web UI (profiles are managed at my.nextdns.io).",
55+
"type": "info"
56+
},
57+
{
58+
"text": "Router mode (-setup-router) makes this LXC the DNS server for your network.",
59+
"type": "info"
60+
},
61+
{
62+
"text": "Updates use the official NextDNS apt repository (repo.nextdns.io). Run the container update script or apt upgrade inside the LXC.",
63+
"type": "info"
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)