Foro de elhacker.net

Comunicaciones => Redes => Mensaje iniciado por: danielo- en 7 Marzo 2011, 00:56 am



Título: Error al buscar el archivo /etc/init.d/bind9
Publicado por: danielo- en 7 Marzo 2011, 00:56 am
Hola a todos! Bueno, pues soy novato en esto de la instalación de servicios, y me toca instalar un servidor DNS en linux, para  una red local, resulta que realizo la instalación de bind9 y creo los archivos de configuración, pero a la hora de realizar el  último comando, simplemente no me es posible encontrarlo
Código
  1. /etc/init.d/bind9
me devuelve bash: /etc/init.d/bind9: No existe el fichero ó directorio

Ya se que el archivo bind9 no se encuentra ahí, ahora mi pregunta es, ¿Por que?, ¿por que no lo puedo hallar?

... Estoy pensando, que és porque no lo estoy instalando con el apt-get, sino que lo estoy haciendo desde los sources, esto lo hago así, porque fue el requisito para la tarea que estoy realizando.
Si alguien me ayuda a solucionarlo lo agradecería mucho, igual si me recomiendan algún tutorial para instalar y configurar el bind 9 desde los sources, sería de mucha ayuda.
 ;-)


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: madpitbull_99 en 7 Marzo 2011, 12:00 pm
Dentro de este mismo foro hay un taller con tutoriales: [Taller]Instalación/Configuración y Teoría de Servicios en Red (https://foro.elhacker.net/redes/tallerinstalacionconfiguracion_y_teoria_de_servicios_en_red-t310026.0.html) y se toca tambien el tema del servicios DNS.

Como parte del taller hay un tutorial de configuración de un servidor DNS con Bind9 pero instalándolo con apt-get, échale un vistazo tal vez se te haya escapado algo. También en el post de Libros de Redes/Networking (https://foro.elhacker.net/redes/libros_de_redesnetworking_lectura_recomendada-t303472.0.html) hay un libro que te puede ayudar a montar el servidor DNS: LINUX SYSTEM ADMINISTRATION || Administración de Sistemas Linux.

Prueba a arrancar el servicio con el comando service, aunque dudo que funcione.

Código:
service bind9 status
o
Código:
service bind9 start

Lista el contenido de init.d, tal vez tenga otro nombre, como bind o bind8 (si se trata de una versión mas antigua).



Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: danielo- en 7 Marzo 2011, 17:14 pm
De echo, ya e visto el post anterior, y si me ha servido, pero sigo sin saber como iniciar el servicio una ves hechas las modificaciones, en la carpeta init.d no aparece nada de bind, lo unico que aparece es el named, la versiòn de bind que estoy instalando es la 9.8..  :-(...


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: y0g-s0th0th en 7 Marzo 2011, 19:12 pm
el servicio se arranca como "named" no como "bind". nunca instale dns en ubuntu pero me imagino q sera lo mismo.


saludos


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: bl4ckf1re en 7 Marzo 2011, 19:55 pm
http://www.tail-f.com.ar/sistemas-operativos/gnu-linux/instalar-bind-en-linux.html
Este link te pudiera servir, lo que entiendo es que no se te creó el script y lo que debes hacer es crearlo por tu cuenta, como lo dice este manual >:D.


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: Darvein en 8 Marzo 2011, 15:39 pm
mirá a lo mejor pueda servirte esto.. yo tengo esto dentro de el archivo /etc/init.d/bind9

Código:
#!/bin/sh -e

### BEGIN INIT INFO
# Provides:          bind9
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Should-Start:      $network $syslog
# Should-Stop:       $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop bind9
# Description:       bind9 is a Domain Name Server (DNS)
#        which translates ip addresses to and from internet names
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

# for a chrooted server: "-u bind -t /var/lib/named"
# Don't modify this line, change or create /etc/default/bind9.
OPTIONS=""
RESOLVCONF=no

test -f /etc/default/bind9 && . /etc/default/bind9

test -x /usr/sbin/rndc || exit 0

. /lib/lsb/init-functions
PIDFILE=/var/run/named/named.pid

check_network() {
    if [ -x /usr/bin/uname ] && [ "X$(/usr/bin/uname -o)" = XSolaris ]; then
IFCONFIG_OPTS="-au"
    else
IFCONFIG_OPTS=""
    fi
    if [ -z "$(/sbin/ifconfig $IFCONFIG_OPTS)" ]; then
       #log_action_msg "No networks configured."
       return 1
    fi
    return 0
}

case "$1" in
    start)
log_daemon_msg "Starting domain name service..." "bind9"

modprobe capability >/dev/null 2>&1 || true

# dirs under /var/run can go away on reboots.
mkdir -p /var/run/named
chmod 775 /var/run/named
chown root:bind /var/run/named >/dev/null 2>&1 || true

if [ ! -x /usr/sbin/named ]; then
    log_action_msg "named binary missing - not starting"
    log_end_msg 1
fi

if ! check_network; then
    log_action_msg "no networks configured"
    log_end_msg 1
fi

if start-stop-daemon --start --oknodo --quiet --exec /usr/sbin/named \
--pidfile ${PIDFILE} -- $OPTIONS; then
    if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then
echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.named
    fi
    log_end_msg 0
else
    log_end_msg 1
fi
    ;;

    stop)
log_daemon_msg "Stopping domain name service..." "bind9"
if ! check_network; then
    log_action_msg "no networks configured"
    log_end_msg 1
fi

if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then
    /sbin/resolvconf -d lo.named
fi
pid=$(/usr/sbin/rndc stop -p | awk '/^pid:/ {print $2}') || true
if [ -z "$pid" ]; then # no pid found, so either not running, or error
    pid=$(pgrep -f ^/usr/sbin/named) || true
    start-stop-daemon --stop --oknodo --quiet --exec /usr/sbin/named \
    --pidfile ${PIDFILE} -- $OPTIONS
fi
if [ -n $pid ]; then
  while kill -0 $pid 2>/dev/null; do
    log_progress_msg "waiting for pid $pid to die"
    sleep 1
  done
fi
log_end_msg 0
    ;;

    reload|force-reload)
log_daemon_msg "Reloading domain name service..." "bind9"
if ! check_network; then
    log_action_msg "no networks configured"
    log_end_msg 1
fi

/usr/sbin/rndc reload >/dev/null && log_end_msg 0 || log_end_msg 1
    ;;

    restart)
if ! check_network; then
    log_action_msg "no networks configured"
    exit 1
fi

$0 stop
$0 start
    ;;
   
    status)
    ret=0
status_of_proc -p ${PIDFILE} /usr/sbin/named bind9 2>/dev/null || ret=$?
exit $ret
;;

    *)
log_action_msg "Usage: /etc/init.d/bind9 {start|stop|reload|restart|force-reload|status}"
exit 1
    ;;
esac

exit 0

y el archivo tiene estos permisos
Citar
$ ls -l /etc/init.d/bind9
-rwxr-xr-x 1 root root 3215 dic  1 20:07 /etc/init.d/bind9


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: danielo- en 8 Marzo 2011, 18:39 pm
 :o  :rolleyes:  :( Gracias por las respuestas,
Consegui hacer que funcione, y si, resulta que era ese archivito el bind que me faltaba, y si no funcionaba, es porque en cada distro se configura de diferente forma, y yo lo intentaba desde un Linux from scratch, pero ahora resulta que tengo otro problema.

Como ya dige antes, lo estoy instalando en un Linux from Scratch, e incluso estoy siguiendo al pie de la letra las instrucciones del Libro Beyond Linux from scratch, y a la hora de ejecutarlo me marca error, si pueden echenle un ojo http://www.linuxfromscratch.org/blfs/view/stable/server/bind.html
y diganme que hago mal, tengo el presentimiento de que me hace falta algun archivo, el named.local o algo así, que creo que el libro obvia que ya fue creado,creeeeeo que eso me esta fallando, pero esque no se como configurarlo, porfavor, si alguien pudiera ayudarme


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: Darvein en 8 Marzo 2011, 19:11 pm
nunca mencionaste "Linux from Scratch" xD

Citar
Create the named.conf file from which named will read the location of zone files, root name servers and secure DNS keys:

Código:
cat > /srv/named/etc/named.conf << "EOF"
 options {
     directory "/etc/namedb";
    pid-file "/var/run/named.pid";
    statistics-file "/var/run/named.stats";

 };
 controls {
     inet 127.0.0.1 allow { localhost; } keys { rndc_key; };
 };
 key "rndc_key" {
     algorithm hmac-md5;
     secret "<Insert secret from rndc-confgen's output here>";
 };
 zone "." {
     type hint;
     file "root.hints";
 };
 zone "0.0.127.in-addr.arpa" {
     type master;
     file "pz/127.0.0";
 };

// Bind 9 now logs by default through syslog (except debug).
// These are the default logging rules.

logging {
     category default { default_syslog; default_debug; };
     category unmatched { null; };

  channel default_syslog {
      syslog daemon;                      // send to syslog's daemon
                                          // facility
      severity info;                      // only send priority info
                                          // and higher
  };

  channel default_debug {
      file "named.run";                   // write to named.run in
                                          // the working directory
                                          // Note: stderr is used instead
                                          // of "named.run"
                                          // if the server is started
                                          // with the '-f' option.
      severity dynamic;                   // log at the server's
                                          // current debug level
  };

  channel default_stderr {
      stderr;                             // writes to stderr
      severity info;                      // only send priority info
                                          // and higher
  };

  channel null {
     null;                                // toss anything sent to
                                          // this channel
  };
};

EOF


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: danielo- en 8 Marzo 2011, 19:24 pm
Ese archivo ya lo cree!, todos los archivos que se encuentran en el tuto antes mencion ado los e creado, pero cuando trato de iniciar con
Código
  1. /etc/rc.d/init.d/bind start
  2.  
aparece
Código
  1. "Starting named..."    [Fail]
y no entiendo porque si sigo todos los pasos del tuto


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: Darvein en 8 Marzo 2011, 19:34 pm
si te dá un fail entonces puedes mirar los logs
 /var/log/syslog y /var/log/messages
y tratar de interpretar que podría estar fallando.


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: danielo- en 8 Marzo 2011, 19:44 pm
ok! lo probare a ver que dice


Título: Re: Error al buscar el archivo /etc/init.d/bind9
Publicado por: adrian12678w531 en 24 Mayo 2023, 05:18 am
DISCULPE QUE ME ENTROMETA PERO ME PODRIAN AYUDAR, YO TENGO EL MISMO CASO, YO ESTOY HACIENDOLO EN DEBIAN 11; QUE CODIGO DEBO PONER EN EL ARCHIVO /etc/rc.d/init.d/bind9