Impostare Bind su osx per Dns Caching
Dopo ultimi problemi con dns a causa di telecom & friends, ho deciso di installare su mac il server Bind in modo da poter usare il caching del dns e velocizzare l’esecuzione di ripetute query verso i siti che visito maggiormente.
Ecco la procedura :
1) Entrate in modalità root soto il terminal:
sudo -s
2) Settare il sistema per usare il bind
vim /etc/hostconfig
Aggiungete alla fine del file
DNSSERVER=-YES-
3) Aggiungete i file di configurazione RNDC
touch /etc/rndc.conf
touch /etc/rndc.conf
4) Settate i file RNDC precedentemente creati
rndc-confgen -p 54
Vi dovrebbe scrivere una cosa del genere
# Start of rndc.conf
key “rndc-key” {
algorithm hmac-md5;
secret “tamY3wYmfNwBuPezMYddcg==”;
};options {
default-key “rndc-key”;
default-server 127.0.0.1;
default-port 54;
};
# End of rndc.conf# Use with the following in named.conf, adjusting the allow list as needed:
# key “rndc-key” {
# algorithm hmac-md5;
# secret “tamY3wYmfNwBuPezMYddcg==”;
# };
#
# controls {
# inet 127.0.0.1 port 54
# allow { 127.0.0.1; } keys { “rndc-key”; };
# };
# End of named.conf
Aggiungete la sezione key{} e option{} in /etc/rndc.conf, e /etc/rndc.key solo con la parte key{}
5) Aggiungete i forwarders. In pratica se il dns del sito che volete visitare non c’è nel db di Bind, allora lui userà ip che avete nel forwarder per risolverli e aggiungere indirizzo al suo db.
vim /etc/named.conf
All’interno della sezione options{} aggiungete i forwarders in modo che risulti qualcosa del tipo
options {
directory “/var/named”;
forwarders {
195.110.128.1;
151.99.125.2;
};
……….
}
/*
(cambiate ip con i dns server che preferite)
6) Lanciate il demone Bind:
launchctl load -w /System/Library/LaunchDaemons/org.isc.named.plist
Questo dovrebbe creare nuova configurazione, salvarla ed avviare il demone.
7 ) Testate il Bind
host www.alice.it 127.0.0.1
Se tutto va bene dovreste avere un output come seguente
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:www.alice.it has address 212.48.10.150
8) Se tutto è andato bene nel punto 7, allora andate in System Preferences->Network->Configure (scheda di rete con cui siete connessi), e settate il valore di DNS server su 127.0.0.1
A questo punto tutto quanto dovrebbe essere ok :)
Related posts:
- Installare subversion su ubuntu 8.04 e configurare svnserve
- Impostare ban automatico dei login via ssh con DenyHost
- Installare subversion 1.6.x su Ubuntu 8.0.4
- Elenco di dns servers sotto Ubuntu
ciao,
ho un problema…come faccio a impostare i server dns da terminale con tiger…riesco a configurare la scheda di rete con ifconfig e il gateway con route…(sto usando tiger su pc e non mi carica in automatico la scheda…mi dice che il cavo non è collegato)
però da terminale ci riesco…ma non navigo perche manca il dns
grazie in anticipo
Tano