Advertisement
Guest User

Untitled

a guest
Oct 6th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.17 KB | None | 0 0
  1. named.conf.options:
  2.  
  3. ```
  4. options {
  5.         directory "/var/cache/bind";
  6.         forwarders {
  7.                 8.8.8.8;
  8.                 1.1.1.1;
  9.                 9.9.9.9;
  10.         };
  11.         dnssec-validation auto;
  12.         auth-nxdomain no;    # conform to RFC1035
  13.         allow-query { any; };
  14.         listen-on port 53 { 127.0.0.1; 192.168.0.101; };
  15.         listen-on-v6 { any; };
  16.         querylog yes;
  17.         rate-limit {
  18.           responses-per-second 10;// # of good responses per prefix-length/sec
  19.           log-only yes;
  20.         };
  21. };
  22. ```
  23.  
  24. named.conf.local:
  25.  
  26. ```
  27. acl slaves {
  28.       69.65.50.192; // ns2.afraid.org
  29. };
  30. acl internals {
  31.     127.0.0.0/8;
  32.     192.168.0.0/24;
  33. };
  34.  
  35. // internal clients only (lan side)
  36. view "internal" {
  37.         match-clients { internals; };
  38.         recursion yes;
  39.  
  40.         ... //irrelevant, for lan side only
  41. };
  42.  
  43. // external clients only (wan side)
  44. view "external" {
  45.     match-clients { any; };
  46.     recursion no;
  47.  
  48.     //forward zone:
  49.     zone "mydomain.tk" {
  50.          type master;
  51.          file "/etc/bind/db.forward.wan";
  52.          allow-transfer { slaves; };
  53.     };
  54. };
  55. ```
  56.  
  57. zone file /etc/bind/db.forward.wan
  58.  
  59. ```
  60. $TTL    604800
  61. mydomain.tk.       IN      SOA     homeserver.ddns.net. root.mydomain.tk. (
  62.                              20         ; Serial
  63.                          604800         ; Refresh
  64.                           86400         ; Retry
  65.                         2419200         ; Expire
  66.                          604800 )       ; Negative Cache TTL
  67.         IN NS homeserver.ddns.net.
  68.         IN NS ns2.afraid.org.
  69. ;
  70.  
  71. @ IN A 86.123.123.123
  72. www IN CNAME mydomain.tk.
  73. ```
  74.  
  75. As you can see
  76. - my homeserver is homeserver.ddns.net, acting as master nameserver
  77. - the domain I am trying to host is mydomain.tk (I guess there's no need for glue records)
  78. - the slave is set as ns2.afraid.org (free backup dns service, it has correctly trasnferred my records, I checked serial)
  79. - there's no need for glue records (my master dns server is homeserver.ddns.net but zone is mydomain.tk)
  80. - I have configured at the mdomain.tk registrar (freenom) 2 NS records pointing to homeserver.ddns.net and ns2.afraid.org
  81.  
  82. Thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement