おうちインフラ

主に自宅のインフラ周りのメモ

ansible bind

bind

  • ansible
~/G/g/c/ansible (master|…) $ ansible-playbook -i environments/home playbooks/bind.yml --list-tasks

playbook: playbooks/bind.yml

  play #1 (bind): bind  TAGS: []
    tasks:
      bind : Load role constants    TAGS: [prometheus_core:main]
      bind : Check bind exists  TAGS: [bind:install]
      bind : Install bind package   TAGS: [bind:install]
      bind : Put named.conf.options file    TAGS: [bind:setup]
      bind : Put named.conf.local file  TAGS: [bind:setup]
      bind : Put zone file  TAGS: [bind:setup]
      bind : Put rev file   TAGS: [bind:setup]
  • named.conf.local
root@rasp-pi01:~# cat /etc/bind/named.conf.local
...
zone "home" {
    type master;
    file "home.zone";
};

zone "1.168.192.in-addr.arpa" {
    type master;
    file "home.rev";
};
  • named.conf.options
root@rasp-pi01:~# cat /etc/bind/named.conf.options
options {
    directory "/etc/bind";

    forwarders {
      8.8.8.8; 8.8.4.4;
    };

    allow-recursion {
      127.0.0.1; 192.168.1.0/24;
    };

    listen-on-v6 { any; };
};
  • dig
~/G/g/c/ansible (master|…) $ dig dns.home @192.168.1.11 +short
192.168.1.11
~/G/g/c/ansible (master|…) $ dig -x 192.168.1.11 @192.168.1.11 +short
home.
~/G/g/c/ansible (master|…) $ dig google.com @192.168.1.11 +short
172.217.161.46