Seu próprio dns pdnsd



apt-get install pdnsd resolvconf

Escolha manual assim que instalar.
Configurar arquivos.

leafpad /etc/default/pdnsd
START_DAEMON=yes

leafpad /etc/pdnsd.conf

global {
    perm_cache=10240; //cache 10M default 2M
    cache_dir="/var/cache/pdnsd";
    run_as="pdnsd";
    server_ip = 127.0.0.1;  // Use eth0 here if you want to allow other ou usar o coringa 0.0.0.0 para escutar em qualquer interface
    status_ctl = on;
    paranoid=off;
//    query_method=tcp_udp;    // pdnsd must be compiled with tcp
// query support for this to work.
// "m", "h", "d", or "w" to the time to specify minutes, hours, days, or weeks.
    min_ttl=2d;       // minimo 2 dias para consultar no server externo
    max_ttl=1w;       // maximo 1 semana para consultar no server externo
    timeout=10;        // Global timeout option (10 seconds).

}

server {
    label = "root-servers";
    root_server=on;
    ip =     8.8.8.8
    ,        8.8.4.4
    ;
    timeout = 5;
    uptest = ping;       // para usar dns do google coloque ping no lugar de query
    interval = 30m;      // Test every half hour.
    ping_timeout = 300;  // 30 seconds.
    purge_cache = off;
    exclude = .localdomain;
    policy = included;
    preset = off;
}

// entrada 2 do roteador
server {
    label="resolvconf";
}

rr {
    name=localhost;
    reverse=on;
    a=127.0.0.1;
    owner=localhost;
    soa=localhost,root.localhost,42,86400,900,86400,86400;
}

source {
 ttl=86400;
 owner="localhost.";
 serve_aliases=on;
 file="/etc/hosts";
}

/*
neg {
    name=doubleclick.net;
    types=domain;   // This will also block xxx.doubleclick.net, etc.
}
*/

/*
neg {
    name=bad.server.com;   // Badly behaved server you don't want to connect to.
    types=A,AAAA;
}
*/

/* vim:set ft=c: */


service pdnsd restart

Teste com o comando dig.
dig terra.com.br

; <<>> DiG 9.9.5-9+deb8u6-Debian <<>> terra.com.br
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52111
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1024
;; QUESTION SECTION:
;terra.com.br.            IN    A

;; ANSWER SECTION:
terra.com.br.        345600    IN    A    208.84.244.116

;; Query time: 57 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Apr 09 10:33:04 BRT 2016
;; MSG SIZE  rcvd: 57


Informações sobre quanto de cache você já usou ou se os servidores estão funcionando.

 # pdnsd-ctl status

Para saber se o pdnsd está fazendo cache.

pdnsd-ctl status | grep 'memory cache'

O cache pode ser apagada.

pdnsd-ctl empty-cache

Para saber o tempo de resposta do dns faça.

dig google | grep time



Comentários

Postagens mais visitadas deste blog

Roteador Modelo HGW-2501GNP-RC da Vivo

Otimizar Debian com zswap

Como formatar um pendrive no Linux via linha de comando