Jakeukalane

dns

Jun 20th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.97 KB | None | 0 0
  1. #named
  2. apt install bind9
  3. ufw allow 53
  4. nano /etc/bind/named.conf.options
  5.  
  6. forwarders {
  7. 1.1.1.1;
  8. 8.8.8.8;
  9. };
  10. forward only;
  11. dnssec-validation no;
  12. allow-query {any;};
  13. rrset_order {order random;}
  14.  
  15.  
  16. nano /etc/bind/named.conf.local #zones
  17.  
  18. zone "19.10.10.in-addr.arpa" IN {
  19. type master;
  20. file "/etc/bind/bd.19.10.10.in-addr.arpa";
  21. };
  22.  
  23. zone "antonio.com" IN {
  24. type master;
  25. file "/etc/bind/bd.antonio.com";
  26. };
  27.  
  28. mkdir /etc/bind/slaves
  29. chown bind:bind /etc/bind/slaves
  30.  
  31.  
  32. @ IN NS masterdns.unixmen.local.
  33. masterdns IN A 10.10.n.100
  34. client IN A 10.10.n.102
  35.  
  36.  
  37. /etc/bind/bd.n.10.10.in-addr.arpa
  38. @ IN NS masterdns.unixmen.local.
  39. 100 IN PTR masterdns.unixmen.local.
  40. 102 IN PTR client.unixmen.local.
  41.  
  42.  
  43. allow-transfer{ 10.10.n.101; }; ### Slave DNS IP ###
  44.  
  45. zone"unixmen.local" IN {
  46. type master;
  47. file "/etc/bind/bd.forward.unixmen";
  48. };
  49. zone"n.10.10.in-addr.arpa" IN {
  50. type master;
  51. file "/etc/bind/bd.n.10.10.in-addr.arpa";
  52. };
  53.  
  54.  
  55. ###/etc/bind/bd.forward.unixmen
  56.  
  57. $TTL 2d
  58. @ IN SOA masterdns.unixmen.local. root.unixmen.local. (
  59. 2011071001 ;Serial
  60. 3600 ;Refresh
  61. 1800 ;Retry
  62. 604800 ;Expire
  63. 86400 ;Minimum TTL
  64. )
  65. @ IN NS masterdns.unixmen.local.
  66. @ IN NS secondarydns.unixmen.local.
  67. masterdns IN A 10.10.n.100
  68. secondarydns IN A 10.10.n.101
  69. client IN A 10.10.n.102
  70.  
  71. ###/etc/bind/bd.n.10.10.in-addr.arpa
  72.  
  73. $TTL 2d
  74. @ IN SOA masterdns.unixmen.local. root.unixmen.local. (
  75. 2011071001 ;Serial
  76. 3600 ;Refresh
  77. 1800 ;Retry
  78. 604800 ;Expire
  79. 86400 ;Minimum TTL
  80. )
  81. @ IN NS masterdns.unixmen.local.
  82. @ IN NS secondarydns.unixmen.local.
  83. 100 IN PTR masterdns.unixmen.local.
  84. 102 IN PTR client.unixmen.local.
  85.  
  86. nslookup
  87. > server 10.10.n.100
  88. > set type=A
  89. > masterdns.unixmen.local (the answer should be: 10.10.n.100)
  90. > client.unixmen.local (the answer should be: 10.10.n.102)
  91. > set type=PTR
  92. > 10.10.n.100 (the answer should be: masterdns.unixmen.local)
  93. > 10.10.n.102 (the answer should be: client.unixmen.local)
  94.  
  95.  
  96.  
  97. #slave
  98. #mkdir /etc/bind/slaves
  99. #chown bind:bind /etc/bind/slaves
  100. zone"unixmen.local" {
  101. type slave;
  102. file "/etc/bind/slaves/copia.forward.unixmen";
  103. masters { 10.10.n.100; };
  104. };
  105. zone"n.10.10.in-addr.arpa" {
  106. type slave;
  107. file "/etc/bind/slaves/copia.n.10.10.in-addr.arpa";
  108. masters { 10.10.n.100; };
  109. };
  110.  
  111.  
  112. options {
  113. .......................................
  114. forwarders {
  115. 1.1.1.1;
  116. 8.8.8.8;
  117. };
  118. forward only;
  119. dnssec-validation no;
  120. allow-query {any;};
  121. rrset-order {order random;};
  122. .......................................
  123. };
  124.  
  125. Archivo: /etc/bind/named.conf.local
  126.  
  127. zone "puesto50.2asir" IN {
  128. type master;
  129. file "/etc/bind/bd.puesto50.2asir";
  130.  
  131. };
  132.  
  133. zone "50.10.10.in-addr.arpa" IN {
  134. type master;
  135. file "/etc/bind/bd.50.10.10.in-addr.arpa";
  136.  
  137. };
  138.  
  139. zone "www.nba.com" IN {
  140. type master;
  141. file "/etc/bind/bd.www.nba.com";
  142.  
  143. };
  144.  
  145.  
  146.  
  147. Archivo: bd.puesto50.2asir
  148.  
  149. $TTL 3H
  150. @ IN SOA ns1.puesto50.2asir. admin.puesto50.2asir. (
  151. 1 ; serial
  152. 1D ; refresh
  153. 1H ; retry
  154. 1W ; expire
  155. 3H ) ; minimum
  156. @ IN NS ns1.puesto50.2asir.
  157. @ IN NS ns2.puesto50.2asir.
  158. ns1 IN A 10.10.50.11
  159. ns2 IN A 10.10.50.12
  160. router IN A 10.10.50.1
  161. www IN A 10.10.50.20
  162. impresora IN A 10.10.50.21
  163. correo IN A 10.10.50.22
  164. @ IN MX 10 correo.puesto50.2asir.
  165. minombre IN TXT "Nombre Apellido1 Apellido2"
  166. buscador IN CNAME www.google.es.
  167.  
  168. Archivo: bd.50.10.10.in-addr.arpa
  169.  
  170. $TTL 3H
  171. @ IN SOA ns1.puesto50.2asir. admin.puesto50.2asir. (
  172. 1 ; serial
  173. 1D ; refresh
  174. 1H ; retry
  175. 1W ; expire
  176. 3H ) ; minimum
  177. @ IN NS ns1.puesto50.2asir.
  178. @ IN NS ns2.puesto50.2asir.
  179. 1 IN PTR router.puesto50.2asir.
  180. 11 IN PTR ns1.puesto50.2asir.
  181. 12 IN PTR ns2.puesto50.2asir.
  182. 20 IN PTR www.puesto50.2asir.
  183. 21 IN PTR impresora.puesto50.2asir.
  184. 22 IN PTR correo.puesto50.2asir.
  185.  
  186. Archivo: bd.www.nba.com
  187.  
  188. @ IN SOA ns1.puesto50.2asir. admin.nba.com. (
  189. 1 ; serial
  190. 1D ; refresh
  191. 1H ; retry
  192. 1W ; expire
  193. 3H ) ; minimum
  194. @ IN NS ns1.puesto50.2asir.
  195. @ IN NS ns2.puesto50.2asir.
  196. @ IN A 1.2.3.4
  197. @ IN A 5.6.7.8
  198. @ IN A 9.10.11.12
  199.  
  200. #####slaves
  201. Archivo: /etc/bind/named.conf.options configurar lo siguiente dentro del bloque options:
  202.  
  203. options {
  204. .......................................
  205. forwarders {
  206. 1.1.1.1;
  207. 8.8.8.8;
  208. };
  209. forward only;
  210. dnssec-validation no;
  211. allow-query {any;};
  212. rrset-order {order random;};
  213. .......................................
  214. };
  215.  
  216.  
  217. Archivo: /etc/bind/named.conf.local
  218.  
  219. zone "puesto50.2asir" IN {
  220. type slave;
  221. file "/etc/bind/slaves/bd.puesto50.2asir";
  222. masters { 10.10.50.11; };
  223. };
  224.  
  225. zone "50.10.10.in-addr.arpa" IN {
  226. type slave;
  227. file "/etc/bind/slaves/bd.50.10.10.in-addr.arpa";
  228. masters { 10.10.50.11; };
  229. };
  230.  
  231. zone "www.nba.com" IN {
  232. type slave;
  233. file "/etc/bind/slaves/bd.www.nba.com";
  234. masters { 10.10.50.11; };
  235. };
  236.  
  237.  
  238.  
  239.  
  240. DELEGACIÓN
  241. Archivo: /etc/bind/named.conf.options
  242.  
  243. options {
  244. ..........
  245. //No se debe configurar NINGÚN FORWARDER o bien usar forward first
  246.  
  247. forwarders {
  248. 1.1.1.1;
  249. 8.8.8.8;
  250. };
  251. forward first;
  252.  
  253. ...........
  254. };
  255.  
  256. Archivo: /etc/bind/named.conf.local zone "2asir" IN {
  257. type master;
  258. file "/etc/bind/bd.2asir";
  259. };
  260.  
  261.  
  262. Archivo: /etc/bind/bd.2asir (Desde el puesto n=50 se delegan los subdominios puesto1, puesto3, ...)
  263.  
  264. $TTL 3H
  265. @ IN SOA ns1.puesto50.2asir. admin.puesto50.2asir. (
  266. 1 ; serial
  267. 1D ; refresh
  268. 1H ; retry
  269. 1W ; expire
  270. 3H ) ; minimum
  271. @ IN NS ns1.puesto50.2asir.
  272. ns1.puesto50 IN A 10.10.50.11 ;Glue record
  273. router.puesto50 IN A 10.10.50.1
  274. www.puesto50 IN A 10.10.50.20
  275. impresora.puesto50 IN A 10.10.50.21
  276. correo.puesto50 IN A 10.10.50.22
  277. puesto50 IN MX 10 correo.puesto50.2asir.
  278. minombre.puesto50 IN TXT "Nombre Apellido1 Apellido2"
  279.  
  280. puesto1 IN NS ns1.2asir. ;Se delega el subdominio puesto1.2asir en el servidor ns1.2asir
  281. ns1 IN A 10.10.1.11 ;Glue record
  282. puesto2 IN NS ns2.2asir. ;Se delega el subdominio puesto2.2asir en el servidor ns2.2asir
  283. ns2 IN A 10.10.2.11 ;Glue record
  284. puesto3 IN NS ns3.2asir. ;Se delega el subdominio puesto3.2asir en el servidor ns3.2asir
  285. ns3 IN A 10.10.3.11 ;Glue record
  286.  
Advertisement
Add Comment
Please, Sign In to add comment