Jump to content
View in the app

A better way to browse. Learn more.

Portal do Host

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Bom dia!

Estou com uma dúvida na configuração do Bind DNS.

O que devo colocar nos parametros allow-transfer, allow-query, allow-notify e allow-recursion?

Estou com receio de deixar o servidor DNS aberto demais ou fechado demais e ocorrer erros na propagação. Alguém teria alguma dica sobre isso:

Atualmente meu named.conf está assim:

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

controls {
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};

acl "trusted" { 127.0.0.1; };

options {
	listen-on port 53 { any; };
	#listen-on-v6 port 53 { any; };
	listen-on-v6 { none; };
	directory 	"/var/named";
	dump-file 	"/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
	recursion yes;

	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";

	managed-keys-directory "/var/named/dynamic";

	allow-recursion { trusted; };
	allow-notify { trusted; };
	allow-transfer {
		any;
		};
	forwarders { 127.0.0.1; };
	also-notify {
		};
	version "None";
	allow-query {
		any;
		};
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/rndc.key";

zone "domain1.com.br" {
	type master;
	file "/var/named/domain1.com.br.hosts";
	allow-transfer {
		127.0.0.1;
		localnets;
		};
	allow-query {
		any;
		};
	};
zone "domain2.com.br" {
	type master;
	file "/var/named/domain2.com.br.hosts";
	allow-transfer {
		127.0.0.1;
		localnets;
		};
	allow-query {
		any;
		};
	};

 


allow-query e allow-recursion: apenas 127.0.0.1. No momento está aberto para o mundo e você é um potencial amplificador de ataques. 

allow-notify, allow-transfer e also-notify: apenas 127.0.0.1 e o IP do servidor secundário.

 

 

 

 


  • Author

Ficaria assim? Você mudaria algo a mais ai? Para aumentar a segurança? Ou está ótimo assim?

#EDIT

Eu testei com essas configurações e as ferramentas de Checagem de DNS, exemplo da PingDom não funcionaram. Ai eu tive que colocar o parâmetro allow-query { any; }; para funcionar, por que? E também aparece esse erro:

Citar

The name server failed to answer queries sent over TCP. This is probably due to the name server not correctly set up or due to misconfgured filtering in a firewall. It is a rather common misconception that DNS does not need TCP unless they provide zone transfers - perhaps the name server administrator is not aware that TCP usually is a requirement.

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

controls {
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};

acl "trusted" { 127.0.0.1;  };

options {
	listen-on port 53 { any; };
	#listen-on-v6 port 53 { any; };
	listen-on-v6 { none; };
	directory 	"/var/named";
	dump-file 	"/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
	recursion yes;

	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";

	managed-keys-directory "/var/named/dynamic";

	allow-recursion { 127.0.0.1; };
	allow-query { 127.0.0.1; };
	allow-notify { 127.0.0.1; 201.131.144.20; };
	allow-transfer { 127.0.0.1; 201.131.144.20; };
	also-notify { 127.0.0.1; 201.131.144.20; };
	forwarders { 127.0.0.1; };
	version "None";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/rndc.key";

zone "domain1.com.br" {
	type master;
	file "/var/named/domain1.com.br.hosts";
	allow-transfer {
		127.0.0.1;
		localnets;
		201.131.144.20;
		};
	};
zone "domain2.com.br" {
	type master;
	file "/var/named/domain2.com.br.hosts";
	allow-transfer {
		127.0.0.1;
		localnets;
		201.131.144.20;
		};
	};

 


Forwarders não é para ter nada. 

O allow-query eu tinha eu confundido com o allow-query-cache, que está faltando na sua configuração. 

allow-query-cache { trusted } ;

allow-query { any } ;

 

 


  • Author

Vou adicionar isso então.

Em mais algum lugar eu uso o 'trusted' ou só ai?

Obrigado pela ajuda.


13 hours ago, marcelorp said:

Vou adicionar isso então.

Em mais algum lugar eu uso o 'trusted' ou só ai?

Obrigado pela ajuda.

Eu usaria em todos ao invés de só ali, pois se torna mais simples ter um único lugar só para alterar. trusted não é uma variável default, está definida mais acima:

acl "trusted" { 127.0.0.1; };

Se você mudasse para 

acl "trusted" { 127.0.0.1; 201.131.144.20; };

Poderia usar trusted em todos esses lugares ao invés de, se um dia precisar alterar, ter que caçar todas as ocorrências. 

201.131.144.20

  • Author

Obrigado novamente. Ficou assim:

Agora está correto? Engraçado que quando eu salvo os dados via Virtualmin ele limpa os dados e deixa o 'also-notify' limpo, sem eu pedir isso. Sabe o por que?

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

controls {
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};

acl "trusted" { 127.0.0.1; 201.231.144.19; 201.231.144.20; localnets; };

options {
	listen-on port 53 { any; };
	#listen-on-v6 port 53 { any; };
	listen-on-v6 { none; };
	directory 	"/var/named";
	dump-file 	"/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
	recursion no;

	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";

	managed-keys-directory "/var/named/dynamic";

	allow-recursion { trusted; };
	allow-query { any; };
	allow-query-cache { trusted; };
	allow-notify { trusted; };
	allow-transfer { trusted; };
	also-notify { trusted; };
	forwarders { };
	version "None";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/rndc.key";

zone "domain1.com.br" {
	type master;
	file "/var/named/domain1.com.br.hosts";
	allow-transfer { trusted; };
	};
zone "domain2.com.br" {
	type master;
	file "/var/named/domain2.com.br.hosts";
	allow-transfer { trusted; };
	};

 


1 hour ago, marcelorp said:

Agora está correto? Engraçado que quando eu salvo os dados via Virtualmin ele limpa os dados e deixa o 'also-notify' limpo, sem eu pedir isso. Sabe o por que?

Para mim parece correto. Não uso via painéis então não sei porque ele está implicando... 

 

 


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Do you agree with our terms?

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.