Linux.named: Unterschied zwischen den Versionen

Aus OrgaMon Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 28: Zeile 28:
    
    
       options {
       options {
 
 
         ->    auth-nxdomain no;
         ->    auth-nxdomain no;
               # The directory statement defines the name server's
               # The directory statement defines the name server's
               # working directory
               # working directory
               directory "/var/named";
               directory "/var/named";
               # The forwarders record contains a list of servers to
               # The forwarders record contains a list of servers to
Zeile 41: Zeile 41:
    
    
               # forwarders { 10.11.12.13; 10.11.12.14; };
               # forwarders { 10.11.12.13; 10.11.12.14; };
       ->    forwarders { 194.25.2.129; 212.185.248.148; };
       ->    forwarders { 194.25.2.129; 212.185.248.148; };
               # Enable the next entry to prefer usage of the name
               # Enable the next entry to prefer usage of the name
               # server declared in the forwarders section.
               # server declared in the forwarders section.
       ->    forward first;
       ->    forward first;
               # The listen-on record contains a list of local network
               # The listen-on record contains a list of local network
               # interfaces to listen on. Optionally the port can be
               # interfaces to listen on. Optionally the port can be
               # specified. Default is to listen on all interfaces found
               # specified. Default is to listen on all interfaces found
               # on your system. The default port is 53.
               # on your system. The default port is 53.
               # listen-on port 53 { 127.0.0.1; };
               # listen-on port 53 { 127.0.0.1; };
               # The listen-on-v6 record enables or disables listening
               # The listen-on-v6 record enables or disables listening
               # on IPV6 interfaces. Allowed values are 'any' and 'none'
               # on IPV6 interfaces. Allowed values are 'any' and 'none'
Zeile 62: Zeile 62:
    
    
               listen-on-v6 { any; };
               listen-on-v6 { any; };
               # The next three statements may be needed if a firewall
               # The next three statements may be needed if a firewall
               # stands between the local server and the internet.
               # stands between the local server and the internet.
               # query-source address * port 53;
               # query-source address * port 53;
               # transfer-source * port 53;
               # transfer-source * port 53;
Zeile 73: Zeile 73:
           # IP-addresses to accept and deny queries from. The
           # IP-addresses to accept and deny queries from. The
           # default is to allow queries from all hosts.
           # default is to allow queries from all hosts.
           # allow-query { 127.0.0.1; };
           # allow-query { 127.0.0.1; };
 
 
           # If notify is set to yes (default), notify messages are
           # If notify is set to yes (default), notify messages are
           # sent to other name servers when the the zone data is
           # sent to other name servers when the the zone data is
Zeile 81: Zeile 81:
           # in the 'options' section, a separate 'notify' can be
           # in the 'options' section, a separate 'notify' can be
           # added to each zone definition.
           # added to each zone definition.
         notify no;
         notify no;
       };
       };
   # The following three zone definitions don't need any modification.
   # The following three zone definitions don't need any modification.
   # The first one defines localhost while the second defines the
   # The first one defines localhost while the second defines the
Zeile 94: Zeile 94:
         file "localhost.zone";
         file "localhost.zone";
   };
   };
   zone "0.0.127.in-addr.arpa" in {
   zone "0.0.127.in-addr.arpa" in {
         type master;
         type master;
         file "127.0.0.zone";
         file "127.0.0.zone";
   };
   };
   zone "." in {
   zone "." in {
         type hint;
         type hint;
         file "root.hint";
         file "root.hint";
   };
   };
   # You can insert further zone records for your own domains below.
   # You can insert further zone records for your own domains below.
   
   

Version vom 4. August 2005, 08:31 Uhr

<h>lokaler DNS Forwarder</h>

DNS-Adressen wechseln ganz im Gegensatz zu HTML-Inhalten nicht so h䵦ig. Deshalb will ich keinen vollst䮤igen Proxy einsetzten. Aber ich will nicht, dass jede (wiederholte) DNS Anfrage ins Internet rausgepustet wird! Bis sich alle Datenbanken weltweit angeglichen haben kann schon mal ein halber Tag vergehen, also k?n wir auch guten gewissens DNS anfragen cache, etwa mit einer Haltbarkeit der cache inhalte von 10 min ?!. Deshalb ist ein Caching unbedenklich, und auch besonders lohnend, da einige UDP/TCP Verbindungsaufbau-Vorg䮧e lokal abgewickelt werden k?n! Die Idee liegt nahe, hey man k?e den Linux-Server doch auch als Name-Server (DNS-relay) einsetzen. Egal welcher Provider dann angew䨬t ist (=welcher nameserver auch immer angegeben werden muss) der lokale DNS-Server leitet alle Anfragen immer an die richtige Adresse (nä­¬ich an den Nameserver draussen im INternet) weiter. Wie die jeweiligen namenserver heissen steht ja in der /etc/resolv.conf. Die Clients m?nix mehr umstellen (im Feld Nameserver)! Gateway UND Nameserver haben dann die gleiche Zieladresse. Hier ist die L?g:

Zuerst werden die Pakete [bind9] aus der Serie [n] sowie die [bind9-utils] installiert.

chkconfig --add named 

Danach in der Datei "/etc/named.conf" folgende, mit den Pfeilen markierten Anpassungen eintragen:

-------------------------------------------------------------------------
 
      options {
 
       ->     auth-nxdomain no;

              # The directory statement defines the name server's
              # working directory

              directory "/var/named";
              # The forwarders record contains a list of servers to
              # which queries should be forwarded. Enable this line and
              # modify the IP-address to your provider's name server.
              # Up to three servers may be listed.
 
              # forwarders { 10.11.12.13; 10.11.12.14; };

      ->     forwarders { 194.25.2.129; 212.185.248.148; };

              # Enable the next entry to prefer usage of the name
              # server declared in the forwarders section.

      ->     forward first;

              # The listen-on record contains a list of local network
              # interfaces to listen on. Optionally the port can be
              # specified. Default is to listen on all interfaces found
              # on your system. The default port is 53.

              # listen-on port 53 { 127.0.0.1; };

              # The listen-on-v6 record enables or disables listening
              # on IPV6 interfaces. Allowed values are 'any' and 'none'
              # or a list of addresses. IPv6 can only be used with
              # kernel 2.4 in this release.
 
              listen-on-v6 { any; };

              # The next three statements may be needed if a firewall
              # stands between the local server and the internet.

              # query-source address * port 53;
              # transfer-source * port 53;
              # notify-source * port 53;
 
         # The allow-query record contains a list of networks or
         # IP-addresses to accept and deny queries from. The
         # default is to allow queries from all hosts.

         # allow-query { 127.0.0.1; };
  
         # If notify is set to yes (default), notify messages are
         # sent to other name servers when the the zone data is
         # changed. Instead of setting a global 'notify' statement
         # in the 'options' section, a separate 'notify' can be
         # added to each zone definition.

       notify no;
      };

 # The following three zone definitions don't need any modification.
 # The first one defines localhost while the second defines the
 # reverse lookup for localhost. The last zone "." is the
 # definition of the root name servers.
 
  zone "localhost" in {
        type master;
        file "localhost.zone";
 };

 zone "0.0.127.in-addr.arpa" in {
        type master;
        file "127.0.0.zone";
 };

 zone "." in {
        type hint;
        file "root.hint";
 };

 # You can insert further zone records for your own domains below.

---------------------------------------------------------------------
  • resolv.conf

Jetzt ist noch in der Datei "/etc/resolv.conf" anzugeben, dass man zur Namensaufl?g den lokalen DNS-Server benutzt.

------------------------------------------------------------------------

   search
   nameserver 127.0.0.1
------------------------------------------------------------------------
  • sysconfig/network/config

Damit die "/etc/resolv.conf" nicht bei jeder Einwahl wieder ?hrieben wird muss der Parameter

joe /etc/sysconfig/network/config
 
MODIFY_RESOLV_CONF_DYNAMICALLY=no
MODIFY_NAMED_CONF_DYNAMICALLY=yes      # Dadurch werden die "forwarders" in der"/etc/named.conf" bei jeder Einwahl aktualisiert


Damit wieder alles seine Richtigkeit hat muss nun SuSEconfig ausgef?erden (nicht sicher, ob das notwendig ist)

SuSEconfig
  • and-firewall
Nun m?die neuen Gegebenheiten der Firewall mitgeteilt werden. Folgende 
Zeilen werden im Script "/root/fwdsl.start" nach der Sektion 
"# E-Mail zum relayen" 
hinzugef?  --------------------------------------------------------------------------------
  # DNS-Forwarding
   $IPTABLES -A INPUT  -i $DEV_INT  -s $INT_NET -p TCP --sport $HIGH_PORT --dport 53 -m state --state NEW,ESTABLISHED,RELATED -j
   $IPTABLES -A INPUT  -i $DEV_INT  -s $INT_NET -p UDP --sport $HIGH_PORT --dport 53 -m state --state NEW,ESTABLISHED,RELATED -j
   $IPTABLES -A OUTPUT -o $DEV_ISDN -p TCP --sport $HIGH_PORT --dport 53 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
   $IPTABLES -A OUTPUT -o $DEV_ISDN -p UDP --sport $HIGH_PORT --dport 53 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
 ------------------------------------------------------------------------


 Zum Abschluß werden auf den Windows-Clients in den Netzwerkeinstellungen bei den
 TCP/IP-Eigenschaften unter Gateway und DNS die IP-Adresse des LINUX-Servers
 angegeben.