Como eu sei se o bind/dns esta funcionando?
Li todos os artigos que estava em: https://under-linux.org/modules.php?name=Sections&op=listarticles&secid=1&PHPSESSID=ed889ebbb34dc8479569d416036a3b6b
e achei mais fácil configurar o bind/dns pelo: https://under-linux.org/modules.php?name=Sections&op=viewarticle&artid=222.
Segui todos os passos mas não sei se o bind/dns esta funcionando. Quando digito "service named start" e depois "service named status" aparece uma mensagem de erro. Vejam abaixo:
"
[root@rh9-test root]# service named start
[root@rh9-test root]# service named status
rndc: connect failed: connection refused
[root@rh9-test root]#
"
Abaixo estão meus arquivos de configuração do bind/dns. Espero que possam me ajudar.
O que esta em "/var/named/primary" é o lasertest.conf
"
zone "lasertest.laser.br" {
type master;
file "zone/db.lasertest";
};
zone "130.172.168.192.in-addr.arpa" {
type master;
file "zone/rev.lasertest";
};
"
Os que estão em "/var/named/zone" são: db.lasertest e e rev.lasertest respectivamente
"
$TTL 86400
@ IN SOA lasertest.laser.br. postmaster.lasertest.laser.br. (
2003090200 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS lasertest.laser.br.
@ IN NS ns.lasertest.laser.br.
lasertest.laser.br. IN A 192.168.172.130
ns.lasertest.laser.br. IN A 192.168.172.130
ftp IN A 192.168.172.130
www IN CNAME lasertest.laser.br.
mail IN A 192.168.172.130
@ IN MX 5 mail.lasertest.laser.br.
pop IN CNAME mail.lasertest.laser.br.
smtp IN CNAME mail.lasertest.laser.br.
"
"
$TTL 86400
@ IN SOA lasertest.laser.br. postmaster.lasertest.laser.br. (
2003092002 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS lasertest.laser.br.
192.168.172.130.in-addr.arpa. IN PTR lasertest.laser.br.
"
Agora o named.conf
"
include "/var/named/primary/lasertest.conf"
"
Como eu sei se o bind/dns esta funcionando?
eu sempre faco assim:
named && tail -f /var/log/messages
ira mostrar os erros pertencentes ao servico named durante a tentativa de "startar" o mesmo.
com as mensagens de erro voce pode alterar os arquivos que correspondem aos erros acontecidos.
ou digite:
host home_de_um_host_cadastrado_no_arquivo_de_zona_direta
host ip_de_um_host_cadastrado_no_arquivo_de_zona_direta
Como eu sei se o bind/dns esta funcionando?
digite o seguinte comando :
dig seudominio.com.br
Este comando lhe mostrara se o seu dominio esta funcionando
corretamente ou nao .
Como eu sei se o bind/dns esta funcionando?
Consertei o named.conf pois faltava um ponto e vírgula no final do arquivo e aí fiz o seguinte: Digitei no terminal: " named && tail -f /var/log/messages" e me apareceu a seguinte mensagem:
"
Oct 9 09:17:36 rh9-test gconfd (root-1162): Resolved address "xml:readwrite:/root/.gconf" to a writable config source at position 1
Oct 9 09:17:36 rh9-test gconfd (root-1162): Resolved address "xml:readonly:/etc/gconf/gconf.xml.defaults" to a read-only config source at position 2
Oct 9 09:17:44 rh9-test kernel: cdrom: This disc doesn´t have any tracks I recognize!
Oct 9 09:21:24 rh9-test ntpd[706]: kernel time discipline status change 41
Oct 9 09:22:09 rh9-test nmbd[975]: [2003/10/09 09:22:09, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Oct 9 09:22:09 rh9-test nmbd[975]: query_name_response: Multiple (2) responses received for a query on subnet 192.168.172.130 for name LASERTOOLS<1d>.
Oct 9 09:22:09 rh9-test nmbd[975]: This response was from IP 192.168.172.161, reporting an IP address of 192.168.172.161.
Oct 9 09:22:27 rh9-test ntpd[706]: kernel time discipline status change 1
Oct 9 09:22:55 rh9-test named[1298]: starting BIND 9.2.1
Oct 9 09:22:55 rh9-test named[1298]: using 1 CPU
Oct 9 09:22:56 rh9-test named[1298]: loading configuration from ´/etc/named.conf´
Oct 9 09:22:56 rh9-test named[1298]: no IPv6 interfaces found
Oct 9 09:22:56 rh9-test named[1298]: listening on IPv4 interface lo, 127.0.0.1#53
Oct 9 09:22:56 rh9-test named[1298]: binding TCP socket: address in use
Oct 9 09:22:56 rh9-test named[1298]: listening on IPv4 interface eth0, 192.168.172.130#53
Oct 9 09:22:56 rh9-test named[1298]: binding TCP socket: address in use
Oct 9 09:22:56 rh9-test named[1298]: couldn´t add command channel 127.0.0.1#953: address in use
Oct 9 09:22:56 rh9-test named[1298]: couldn´t open pid file ´/var/run/named/named.pid´: File exists
Oct 9 09:22:56 rh9-test named[1298]: exiting (due to early fatal error)
"
Depois fui ao terminal novamente e digitei: "dig lasertest.laser.br" e me apareceu a seguinte mensagem:
"
; <<>> DiG 9.2.1 <<>> lasertest.laser.br
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 57504
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;lasertest.laser.br. IN A
;; Query time: 48 msec
;; SERVER: 200.204.0.10#53(200.204.000.10)
;; WHEN: Thu Oct 9 09:23:10 2003
;; MSG SIZE rcvd: 36
"
Como sou novato em linux eu ainda não sei se o bind/dns está funcionando e se está funcionando, como eu acesso as páginas html. php.. pelo ie nas outras estações sem precisar digitar o ip e sim o domínio?.
Como eu sei se o bind/dns esta funcionando?
Oct 9 09:22:56 rh9-test named[1298]: couldn´t add command channel 127.0.0.1#953: address in use
Oct 9 09:22:56 rh9-test named[1298]: couldn´t open pid file ´/var/run/named/named.pid´: File exists
Oct 9 09:22:56 rh9-test named[1298]: exiting (due to early fatal error)
o rndc provavelmente já estará a correr por isso nao deixa criar de novo ...
presta bem em atenção ás configurações no /etc/named.conf
para o serviço e faz um ps ax e cola aqui ... depois inicia o serviço e pasta outro ps ax ..
depois volta a pastar os logs
Como eu sei se o bind/dns esta funcionando?
O named.conf está assim:
nclude "/var/named/primary/lasertest.conf" ;
Fiz os "ps ax" e osretornos foram esses:
"
[root@rh9-test conf]# ps ax
PID TTY STAT TIME COMMAND
1 ? S 0:04 init
2 ? SW 0:00 [keventd]
3 ? SW 0:00 [kapmd]
4 ? SWN 0:00 [ksoftirqd_CPU0]
9 ? SW 0:00 [bdflush]
5 ? SW 0:00 [kswapd]
6 ? SW 0:00 [kscand/DMA]
7 ? SW 0:00 [kscand/Normal]
8 ? SW 0:00 [kscand/HighMem]
10 ? SW 0:00 [kupdated]
11 ? SW 0:00 [mdrecoveryd]
69 ? SW 0:00 [khubd]
450 ? SW 0:00 [eth0]
501 ? S 0:00 syslogd -m 0
505 ? S 0:00 klogd -x
523 ? S 0:00 [portmap]
542 ? S 0:00 [rpc.statd]
608 ? S 0:00 /usr/sbin/apmd -p 10 -w 5 -W -P /etc/sysconfig/apm-scripts/apmscript
648 ? S 0:00 /usr/sbin/httpd
657 ? S 0:00 /usr/sbin/sshd
671 ? S 0:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
672 ? S 0:00 [httpd]
673 ? S 0:00 [httpd]
674 ? S 0:00 [httpd]
675 ? S 0:00 [httpd]
676 ? S 0:00 [httpd]
693 ? SL 0:00 [ntpd]
706 ? S 0:00 rpc.rquotad
711 ? SW 0:00 [nfsd]
712 ? SW 0:00 [nfsd]
713 ? SW 0:00 [nfsd]
714 ? SW 0:00 [nfsd]
715 ? SW 0:00 [nfsd]
716 ? SW 0:00 [nfsd]
717 ? SW 0:00 [nfsd]
718 ? SW 0:00 [nfsd]
719 ? SW 0:00 [lockd]
720 ? SW 0:00 [rpciod]
726 ? S 0:00 rpc.mountd
738 ? S 0:00 /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf
751 ? S 0:00 gpm -t imps2 -m /dev/psaux
784 ? SW 0:00 [mysqld]
814 ? S 0:00 /usr/bin/postmaster -p 5432
817 ? S 0:00 postgres: stats buffer process
818 ? S 0:00 postgres: stats collector process
830 ? SW 0:00 [cannaserver]
841 ? S 0:00 crond
852 ? S 0:00 cupsd
890 ? SW 0:00 [jserver]
949 ? S 0:00 [xfs]
958 ? S 0:00 smbd -D
962 ? S 0:00 nmbd -D
971 ? S 0:00 /usr/bin/lisa --config=/etc/lisarc
989 ? S 0:00 [atd]
999 ? S 0:00 rhnsd --interval 240
1009 ? S 0:00 /usr/bin/lisa --config=/etc/lisarc
1011 ? S 0:00 /usr/bin/perl /usr/libexec/usermin/miniserv.pl /etc/usermin/miniserv.conf
1018 ? S 0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
1021 tty1 S 0:00 /sbin/mingetty tty1
1022 tty2 S 0:00 /sbin/mingetty tty2
1023 tty3 S 0:00 /sbin/mingetty tty3
1024 tty4 S 0:00 /sbin/mingetty tty4
1025 tty5 S 0:00 /sbin/mingetty tty5
1026 tty6 S 0:00 /sbin/mingetty tty6
1027 ? S 0:00 [gdm-binary]
1070 ? S 0:00 [gdm-binary]
1071 ? S 0:03 /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt7
1080 ? S 0:00 /usr/bin/gnome-session
1138 ? S 0:00 /usr/bin/ssh-agent /etc/X11/xinit/Xclients
1149 ? S 0:00 /usr/libexec/gconfd-2 11
1151 ? S 0:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=16
1153 ? S 0:00 gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME_SettingsDaemon --oaf-ior-fd=14
1158 ? S 0:00 [fam]
1165 ? S 0:00 metacity --sm-save-file 1065723165-1181-1284556968.ms
1167 ? S 0:01 gnome-panel --sm-config-prefix /gnome-panel-g0o8Ux/ --sm-client-id 117f000001000106389348900000012 1169 ? S 0:01 nautilus --sm-config-prefix /nautilus-4eRJ1d/ --sm-client-id 117f000001000106389349000000012880003 1171 ? S 0:00 magicdev --sm-config-prefix /magicdev-oeWE3A/ --sm-client-id 117f000001000106389348900000012880002 1173 ? S 0:00 gnome-terminal --sm-config-prefix /gnome-terminal-NKti9z/ --sm-client-id 117f000001000106423618800 1175 ? S 0:00 eggcups --sm-config-prefix /eggcups-XlAbSv/ --sm-client-id 117f000001000106389349000000012880004 - 1177 ? S 0:00 /usr/bin/pam-panel-icon --sm-client-id 117f000001000106389349100000012880005
1179 ? S 0:00 /usr/bin/python /usr/bin/rhn-applet-gui --sm-config-prefix /rhn-applet-pv0Gf0/ --sm-client-id 117f 1180 ? S 0:00 /sbin/pam_timestamp_check -d root
1184 ? S 0:00 /usr/libexec/nautilus-throbber --oaf-activate-iid=OAFIID:Nautilus_Throbber_Factory --oaf-ior-fd=22 1189 ? S 0:00 [gnome-pty-helpe]
1190 pts/0 S 0:00 bash
1192 pts/1 S 0:00 bash
1243 ? S 0:00 /usr/libexec/notification-area-applet --oaf-activate-iid=OAFIID:GNOME_NotificationAreaApplet_Facto 1245 ? S 0:00 /usr/bin/redhat-config-services
1246 ? S 0:00 /usr/sbin/userhelper -w redhat-config-services
1247 ? S 0:00 /bin/sh /usr/share/redhat-config-services/redhat-config-services
1248 ? S 0:01 /usr/bin/python /usr/share/redhat-config-services/serviceconf.py
1284 pts/1 R 0:00 ps ax
[root@rh9-test conf]# service named start
[root@rh9-test conf]#
[root@rh9-test conf]# ps ax
PID TTY STAT TIME COMMAND
1 ? S 0:04 init
2 ? SW 0:00 [keventd]
3 ? SW 0:00 [kapmd]
4 ? SWN 0:00 [ksoftirqd_CPU0]
9 ? SW 0:00 [bdflush]
5 ? SW 0:00 [kswapd]
6 ? SW 0:00 [kscand/DMA]
7 ? SW 0:00 [kscand/Normal]
8 ? SW 0:00 [kscand/HighMem]
10 ? SW 0:00 [kupdated]
11 ? SW 0:00 [mdrecoveryd]
69 ? SW 0:00 [khubd]
450 ? SW 0:00 [eth0]
501 ? S 0:00 syslogd -m 0
505 ? S 0:00 klogd -x
523 ? S 0:00 [portmap]
542 ? S 0:00 [rpc.statd]
608 ? S 0:00 /usr/sbin/apmd -p 10 -w 5 -W -P /etc/sysconfig/apm-scripts/apmscript
648 ? S 0:00 /usr/sbin/httpd
657 ? S 0:00 /usr/sbin/sshd
671 ? S 0:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
672 ? S 0:00 [httpd]
673 ? S 0:00 [httpd]
674 ? S 0:00 [httpd]
675 ? S 0:00 [httpd]
676 ? S 0:00 [httpd]
693 ? SL 0:00 [ntpd]
706 ? S 0:00 rpc.rquotad
711 ? SW 0:00 [nfsd]
712 ? SW 0:00 [nfsd]
713 ? SW 0:00 [nfsd]
714 ? SW 0:00 [nfsd]
715 ? SW 0:00 [nfsd]
716 ? SW 0:00 [nfsd]
717 ? SW 0:00 [nfsd]
718 ? SW 0:00 [nfsd]
719 ? SW 0:00 [lockd]
720 ? SW 0:00 [rpciod]
726 ? S 0:00 rpc.mountd
738 ? S 0:00 /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf
751 ? S 0:00 gpm -t imps2 -m /dev/psaux
784 ? SW 0:00 [mysqld]
814 ? S 0:00 /usr/bin/postmaster -p 5432
817 ? S 0:00 postgres: stats buffer process
818 ? S 0:00 postgres: stats collector process
830 ? SW 0:00 [cannaserver]
841 ? S 0:00 crond
852 ? S 0:00 cupsd
890 ? SW 0:00 [jserver]
949 ? S 0:00 [xfs]
958 ? S 0:00 smbd -D
962 ? S 0:00 nmbd -D
971 ? S 0:00 /usr/bin/lisa --config=/etc/lisarc
989 ? S 0:00 [atd]
999 ? S 0:00 rhnsd --interval 240
1009 ? S 0:00 /usr/bin/lisa --config=/etc/lisarc
1011 ? S 0:00 /usr/bin/perl /usr/libexec/usermin/miniserv.pl /etc/usermin/miniserv.conf
1018 ? S 0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
1021 tty1 S 0:00 /sbin/mingetty tty1
1022 tty2 S 0:00 /sbin/mingetty tty2
1023 tty3 S 0:00 /sbin/mingetty tty3
1024 tty4 S 0:00 /sbin/mingetty tty4
1025 tty5 S 0:00 /sbin/mingetty tty5
1026 tty6 S 0:00 /sbin/mingetty tty6
1027 ? S 0:00 [gdm-binary]
1070 ? S 0:00 [gdm-binary]
1071 ? S 0:03 /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt7
1080 ? S 0:00 /usr/bin/gnome-session
1138 ? S 0:00 /usr/bin/ssh-agent /etc/X11/xinit/Xclients
1149 ? S 0:00 /usr/libexec/gconfd-2 11
1151 ? S 0:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=16
1153 ? S 0:00 gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME_SettingsDaemon --oaf-ior-fd=14
1158 ? S 0:00 [fam]
1165 ? S 0:00 metacity --sm-save-file 1065723165-1181-1284556968.ms
1167 ? S 0:01 gnome-panel --sm-config-prefix /gnome-panel-g0o8Ux/ --sm-client-id 117f000001000106389348900000012 1169 ? S 0:01 nautilus --sm-config-prefix /nautilus-4eRJ1d/ --sm-client-id 117f000001000106389349000000012880003 1171 ? S 0:00 magicdev --sm-config-prefix /magicdev-oeWE3A/ --sm-client-id 117f000001000106389348900000012880002 1173 ? S 0:01 gnome-terminal --sm-config-prefix /gnome-terminal-NKti9z/ --sm-client-id 117f000001000106423618800 1175 ? S 0:00 eggcups --sm-config-prefix /eggcups-XlAbSv/ --sm-client-id 117f000001000106389349000000012880004 - 1177 ? S 0:00 /usr/bin/pam-panel-icon --sm-client-id 117f000001000106389349100000012880005
1179 ? S 0:00 /usr/bin/python /usr/bin/rhn-applet-gui --sm-config-prefix /rhn-applet-pv0Gf0/ --sm-client-id 117f 1180 ? S 0:00 /sbin/pam_timestamp_check -d root
1184 ? S 0:00 /usr/libexec/nautilus-throbber --oaf-activate-iid=OAFIID:Nautilus_Throbber_Factory --oaf-ior-fd=22 1189 ? S 0:00 [gnome-pty-helpe]
1190 pts/0 S 0:00 bash
1192 pts/1 S 0:00 bash
1243 ? S 0:00 /usr/libexec/notification-area-applet --oaf-activate-iid=OAFIID:GNOME_NotificationAreaApplet_Facto 1245 ? S 0:00 /usr/bin/redhat-config-services
1246 ? S 0:00 /usr/sbin/userhelper -w redhat-config-services
1247 ? S 0:00 /bin/sh /usr/share/redhat-config-services/redhat-config-services
1248 ? S 0:01 /usr/bin/python /usr/share/redhat-config-services/serviceconf.py
1294 ? S 0:00 [named]
1301 pts/1 R 0:00 ps ax
"
Como eu sei se o bind/dns esta funcionando?
Meu, o seu problema está fácil de resolver....saca só...
Você pelo que eu estou vendo está querendo hospedar a sua página em casa/escritório, sei lá onde, mas ae, quando você colocou, no seu arquivo db, o ns.seudominio.com.br, você cometeu um erro!!!!
Bom é o seguinte, ali você ou coloca seudomínio.com.br, ou você segue o padrão de todos os servidores DNS e coloca em todos os lugares onde tiver o seudomínio.com.br, ns.seudominio.com.br
Frm?
Agora, vc quer um geito mais fácil de mudar alguns dados que se repetem várias vezes dentro de um mesmo documento?
Pois ai vai: dentro do editor vi, quando você coloca : para iniciar um comando, geralmente wq! para sair, ao invés de você colocar wq!, você coloca- :%s/nomeasermudado/novonome/g
Falow?
Espero ter ajudado!!!!