Linux.named: Unterschied zwischen den Versionen

Aus OrgaMon Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 35: Zeile 35:
   
   
               directory "/var/named";
               directory "/var/named";
               # The forwarders record contains a list of servers to
               # The forwarders record contains a list of servers to
               # which queries should be forwarded. Enable this line and
               # which queries should be forwarded. Enable this line and
               # modify the IP-address to your provider's name server.
               # modify the IP-address to your provider's name server.
               # Up to three servers may be listed.
               # 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; };
             
      ->      forwarders { 217.237.151.161; 217.237.151.33; };
    
    
              # 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
               # 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
Zeile 55: Zeile 57:
   
   
               # listen-on port 53 { 127.0.0.1; };
               # listen-on port 53 { 127.0.0.1; };
      ->      listen-on port 53 { 127.0.0.1; 192.168.100.181; };
   
   
               # The listen-on-v6 record enables or disables listening
               # The listen-on-v6 record enables or disables listening
Zeile 60: Zeile 64:
               # or a list of addresses. IPv6 can only be used with
               # or a list of addresses. IPv6 can only be used with
               # kernel 2.4 in this release.
               # kernel 2.4 in this release.
 
               listen-on-v6 { any; };
               listen-on-v6 { any; };
   
   
Zeile 70: Zeile 74:
               # notify-source * port 53;
               # notify-source * port 53;
    
    
          # The allow-query record contains a list of networks or
              # The allow-query record contains a list of networks or
          # 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; };
    ->        allow-query { localnets; };    
 
          # 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;
              # 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 following three zone definitions don't need any modification.
Zeile 89: Zeile 95:
   # reverse lookup for localhost. The last zone "." is the
   # reverse lookup for localhost. The last zone "." is the
   # definition of the root name servers.
   # definition of the root name servers.
 
   zone "localhost" in {
   zone "localhost" in {
         type master;
         type master;
Zeile 107: Zeile 113:
   # You can insert further zone records for your own domains below.
   # You can insert further zone records for your own domains below.
   
   
->  zone "pcworld" in {
-> notify no;
-> type master;
-> file "pcworld.zone";
-> allow-query {192.168.100/24; };
-> allow-transfer { none; };
->  };
->    zone "100.168.192.in-addr.arpa" in {
->      type master;
->      file "192.168.100.zone";
->    };
  ---------------------------------------------------------------------
  ---------------------------------------------------------------------



Version vom 5. August 2005, 09:40 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; };
              
      ->      forwarders { 217.237.151.161; 217.237.151.33; }; 
 
              # 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; };

      ->      listen-on port 53 { 127.0.0.1; 192.168.100.181; };

              # 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; };

    ->        allow-query { localnets; };     

              # 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.

->  zone "pcworld" in {
->	notify no;
-> 	type master;
->	file "pcworld.zone";
->	allow-query {192.168.100/24; };
->	allow-transfer { none; };
->  };

->    zone "100.168.192.in-addr.arpa" in {
->       type master;
->       file "192.168.100.zone";
->     };
---------------------------------------------------------------------
  • 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.