Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[howto] dns-update (resolv.conf facile)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
Panda
Apprentice
Apprentice


Joined: 31 Jul 2003
Posts: 223
Location: Cremona <=> Catania

PostPosted: Sat Mar 13, 2004 2:01 pm    Post subject: [howto] dns-update (resolv.conf facile) Reply with quote

Salve a tutti,
dato che ultimamente mi capita spesso di connettermi con diversi ISP o lan mi sono rotto di sistemare a mano ogni volta resolv.conf. Ho risolto il problema con un sistemino+script che vi spiego di seguito, magari potrebbe essere utile a qualcuno.

    1) create la dir /etc/resolv.conf.d e metteteci dentro tutti i vostri resolv.conf nella forma resolv.conf.nome. Inoltre potete anche fare un link simbolico che punti a /etc/ppp/resolv.conf e potete chiamarlo ad esempio resolv.conf.ppp, se vi dovesse capitare di collegarvi via ppp ad un ISP nuovo (e se avete l'opzione di ppp usepeerdns). Esempio:
    Code:
    root@panda panda # ls -l /etc/resolv.conf.d/
    total 13
    -rw-r--r--    1 root     root           95 Mar  6 22:49 resolv.conf.freaknet
    -rw-r--r--    1 root     root           50 Mar  6 22:48 resolv.conf.libero
    lrwxrwxrwx    1 root     root           18 Mar 13 12:10 resolv.conf.ppp -> ../ppp/resolv.conf
    -rw-r--r--    1 root     root           53 Mar  6 22:49 resolv.conf.tim


    2) copiate il seguente scriptino un po' come vi pare ;) Io l'ho messo in /usr/sbin e l'ho chiamato dns-update
    Code:
    root@panda panda # cat /usr/sbin/dns-update
    #! /bin/sh
    source /etc/init.d/functions.sh

    ebegin "Setting $1 dns"
         cat /etc/resolv.conf.d/resolv.conf.$1 > /etc/resolv.conf
    eend $?

A questo punto -come avrete potuto intuire dallo script- vi bastera' lanciare dns-update nomeISP per aggiornare il vostro resolv.conf con i DNS che vi servono al momento. Inutile dire che sono un niubbo di bash scripting e qualsiasi miglioria e' ben accetta.

byez
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Mar 13, 2004 8:43 pm    Post subject: Reply with quote

da niubbo a niubbo.

complimenti. Mi sembra semplice e divertente. Lo devo provare sul portatile, dove ho bisogno di resolv differenti a seconda della conessione.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
Naspe
Guru
Guru


Joined: 10 Dec 2003
Posts: 321
Location: Genova - Italy

PostPosted: Sat Mar 13, 2004 11:46 pm    Post subject: Reply with quote

Scusa ma a me il resolv.conf mi si aggiorna sempre da solo... Ma magari questo è perchè uso il DHCP...

Un'altra cosa... Ma nn puoi lasciare sempre li stessi DNS?
_________________
God Is Real... Unless Declared As Integer...

Provoca Il Più Bravo... Morirai Come Uno Schiavo!!!

Hai Evocato Il Tuono!!! Ora Raccogli Tempesta!!!
Back to top
View user's profile Send private message
nomadsoul
Apprentice
Apprentice


Joined: 14 Mar 2004
Posts: 172

PostPosted: Sun Mar 14, 2004 2:51 am    Post subject: Reply with quote

si infatti... i dns non funzionano comunque??
Back to top
View user's profile Send private message
Peach
Advocate
Advocate


Joined: 08 Mar 2003
Posts: 3686
Location: London, UK

PostPosted: Sun Mar 14, 2004 10:27 am    Post subject: Reply with quote

non sempre gli stessi dns funzionano.. quelli di wind e telecom, per dire, ho notato non essere simpaticamente "compatibili"

a chi interessasse ecco una pagina riassuntiva di un po' di dns:

http://spazioinwind.libero.it/zaccasoft/3hm220dp4all/dns.htm
_________________
Gentoo user since 2004.
"It's all fun and games, until someone loses an eye" - mom
Back to top
View user's profile Send private message
Panda
Apprentice
Apprentice


Joined: 31 Jul 2003
Posts: 223
Location: Cremona <=> Catania

PostPosted: Sun Mar 14, 2004 10:49 am    Post subject: Reply with quote

Beh si, capita che qualche DNS funzioni con provider diversi, ma capita anche che non funzionino poi cosi' tanto bene. Mi era capitato ad esempio che su una Alice funzionassero i DNS di tiscali, ma per 3/4 non mi facevano uscire.

Cmq che ve ne sembra di dns-update?
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sun Mar 14, 2004 12:48 pm    Post subject: Reply with quote

Naspe wrote:
me il resolv.conf mi si aggiorna sempre da solo...


Iom per esempio, devo lavorare con uno stupidissimo modem isdn che fa un firewall a chiunque si azzardi a scrivere un numero diverso da 192.168.0.1 nella prima riga di /etc/resolved.conf.

Molti a cui ho chiesto il motivo, mi hanno detto che il modem ê un po' cosí.

A casa mia, invece. lo script di adsl-start (mandrake, per la veritá), cambia il file e mi costringe ogni volta a riscriverlo a mano.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
I-Ching
n00b
n00b


Joined: 16 Mar 2004
Posts: 50

PostPosted: Tue Mar 16, 2004 5:52 pm    Post subject: Reply with quote

Scusate ma l'uso di un dns locale non risolve il problema in maniera radicale ? C'era anche quello scirpt su gentoo-italia.org che lo installa automaticamente.

Ching
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum