Change text-based dnsmasq config to attribute set

This commit is contained in:
Jakob Lechner 2023-05-27 19:23:04 +00:00
parent 223fa99668
commit 28e9273c48
No known key found for this signature in database
GPG key ID: 996082EFB5906C10
3 changed files with 41 additions and 49 deletions

View file

@ -6,33 +6,30 @@ in
{
services.dnsmasq = {
enable = true;
extraConfig = ''
listen-address=192.168.0.1
listen-address=192.168.1.1
interface=lo
expand-hosts
domain=lan.kbh.jalr.de
dhcp-range=192.168.0.20,192.168.0.254,4h
dhcp-range=192.168.1.20,192.168.1.254,4h
#dhcp-boot=lpxelinux.0,aluminium,192.168.0.1
cache-size=10000
dns-forward-max=1000
no-hosts
addn-hosts=${pkgs.writeText "hosts.dnsmasq" ''
settings = {
listen-address = [
"192.168.0.1"
"192.168.1.1"
];
interface = "lo";
expand-hosts = true;
domain = "lan.kbh.jalr.de";
dhcp-range = [
"192.168.0.20,192.168.0.254,4h"
"192.168.1.20,192.168.1.254,4h"
];
cache-size = 10000;
dns-forward-max = 1000;
no-hosts = true;
addn-hosts = "${pkgs.writeText "hosts.dnsmasq" ''
192.168.0.1 aluminium unifi
''}
'';
servers = [
"142.250.185.78" # dns.as250.net
"2001:470:20::2" # ordns.he.net
"74.82.42.42" # ordns.he.net
];
''}";
server = [
"142.250.185.78" # dns.as250.net
"2001:470:20::2" # ordns.he.net
"74.82.42.42" # ordns.he.net
];
};
};
networking.firewall = {

View file

@ -108,7 +108,7 @@
};
};
services.dnsmasq.servers = [
services.dnsmasq.settings.server = [
"/vpce-0de71527ea27288f3-9op2d61c-eu-central-1b.s3.eu-central-1.vpce.amazonaws.com/10.170.254.30"
"/vpce-0de71527ea27288f3-9op2d61c.s3.eu-central-1.vpce.amazonaws.com/10.170.254.30"
"/ccs.tradebyte.com/10.170.254.30"

View file

@ -6,29 +6,24 @@ in
{
services.dnsmasq = {
enable = true;
extraConfig = ''
listen-address=192.168.42.1
interface=lo
expand-hosts
domain=lan.bw.jalr.de
dhcp-range=192.168.42.20,192.168.42.254,4h
cache-size=10000
dns-forward-max=1000
no-hosts
addn-hosts=${pkgs.writeText "hosts.dnsmasq" ''
settings = {
listen-address = "192.168.42.1";
interface = "lo";
expand-hosts = true;
domain = "lan.bw.jalr.de";
dhcp-range = "192.168.42.20,192.168.42.254,4h";
cache-size = 10000;
dns-forward-max = 1000;
no-hosts = true;
addn-hosts = "${pkgs.writeText "hosts.dnsmasq" ''
192.168.42.1 aluminium unifi
''}
'';
servers = [
"142.250.185.78" # dns.as250.net
"2001:470:20::2" # ordns.he.net
"74.82.42.42" # ordns.he.net
];
''}";
server = [
"142.250.185.78" # dns.as250.net
"2001:470:20::2" # ordns.he.net
"74.82.42.42" # ordns.he.net
];
};
};
networking.firewall = {