nixos: dns ipv6 support
This commit is contained in:
parent
b965765312
commit
a967b6ab05
2 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
{
|
{
|
||||||
hostname = "edgerouter";
|
hostname = "edgerouter";
|
||||||
ip = "10.42.42.1";
|
ip = "10.42.42.1";
|
||||||
|
ip6 = "2001:41f0:9639:1:b6fb:e4ff:fe53:9c0";
|
||||||
mac = "B4:FB:E4:53:9C:0A";
|
mac = "B4:FB:E4:53:9C:0A";
|
||||||
nix = false;
|
nix = false;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +10,7 @@
|
||||||
hostname = "nuc";
|
hostname = "nuc";
|
||||||
ip = "10.42.42.42";
|
ip = "10.42.42.42";
|
||||||
mac = "1C:69:7A:62:30:88";
|
mac = "1C:69:7A:62:30:88";
|
||||||
|
ip6 = "";
|
||||||
nix = false;
|
nix = false;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -20,6 +22,7 @@
|
||||||
{
|
{
|
||||||
hostname = "home-assistant";
|
hostname = "home-assistant";
|
||||||
ip = "10.42.42.8";
|
ip = "10.42.42.8";
|
||||||
|
ip6 = "2001:41f0:9639:1:bfe7:3fd9:75de:cbee";
|
||||||
mac = "74:40:be:48:85:a4";
|
mac = "74:40:be:48:85:a4";
|
||||||
nix = false;
|
nix = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
{ config, pkgs, hosts, ... }:
|
{ config, pkgs, hosts, ... }:
|
||||||
let
|
let
|
||||||
localdomain = "olympus";
|
localdomain = "olympus";
|
||||||
|
ipv6Hosts = builtins.filter (builtins.hasAttr ip6) hosts;
|
||||||
|
|
||||||
localData = { hostname, ip, ... }: ''"${hostname}.${localdomain}. A ${ip}"'';
|
localData = { hostname, ip, ... }: ''"${hostname}.${localdomain}. A ${ip}"'';
|
||||||
|
local6Data = { hostname, ip6, ... }: ''"${hostname}.${localdomain}. AAAA ${ip6}"'';
|
||||||
ptrData = { hostname, ip, ... }: ''"${ip} ${hostname}.${localdomain}"'';
|
ptrData = { hostname, ip, ... }: ''"${ip} ${hostname}.${localdomain}"'';
|
||||||
|
ptr6Data = { hostname, ip6, ... }: ''"${ip6} ${hostname}.${localdomain}"'';
|
||||||
in {
|
in {
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
|
@ -32,8 +36,8 @@ in {
|
||||||
interface = [ "0.0.0.0" "::0" ];
|
interface = [ "0.0.0.0" "::0" ];
|
||||||
|
|
||||||
local-zone = ''"${localdomain}." transparent'';
|
local-zone = ''"${localdomain}." transparent'';
|
||||||
local-data = map localData hosts;
|
local-data = (map localData hosts) ++ (map local6Data ipv6Hosts);
|
||||||
local-data-ptr = map ptrData hosts;
|
local-data-ptr = (map ptrData hosts);
|
||||||
|
|
||||||
access-control = [
|
access-control = [
|
||||||
"127.0.0.1/32 allow_snoop"
|
"127.0.0.1/32 allow_snoop"
|
||||||
|
|
Loading…
Reference in a new issue