logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

Jak skonfigurować bind9 i apache2, aby używać nazw zamiast adresów IP?

marek_kkk 22 Paź 2017 10:01 1641 4
REKLAMA
  • #1 16771191
    marek_kkk
    Poziom 13  
    Posty: 152
    Pomógł: 1
    Ocena: 17
    Witam
    Chciałbym Was prosić o pomoc, mianowicie mam kilkanaście komputerów połączonych w sieć lokalną bez dostępu do internetu. Jeden z komputerów skonfigurowany jest jako serwer Apache2 na którym umieszczone są strony internetowe (aaa, bbb, ccc ) i teraz chciałbym aby osoba, która chce otworzyć jedną ze stron nie wpisywała adresu IP (192.168.0.1) tylko jakąś nazwę np. http://aaa, próbowałem konfiguracji wg tego opisu ale coś nie bardzo chce mi to działać. Jeżeli ktoś mógłby coś podpowiedzieć byłbym bardzo wdzięczny. Poniżej zamieszczam pliki konfiguracyjne bind9 oraz apache2
    pozdrawiam

    Plik apache2.conf (konfiguracja domyślna)
    Plik ports.conf:
    Cytat:
    #If you just change the port or add more ports here, you will likely also
    # have to change the VirtualHost statement in
    # /etc/apache2/sites-enabled/000-default.conf
    Listen 80
    <IfModule ssl_module>
    Listen 443
    </IfModule>
    <IfModule mod_gnutls.c>
    Listen 443
    </IfModule>


    Virtualhosty:
    Cytat:
    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName aaa
    ServerAlias www.aaa
    DocumentRoot /var/www/html/aaa/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    Cytat:

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName bbb
    ServerAlias www.bbb
    DocumentRoot /var/www/html/bbb/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>


    BIND9:
    Plik named.conf:
    Cytat:
    // This is the primary configuration file for the BIND DNS server named.
    //
    // Please read /usr/share/doc/bind9/README.Debian.gz for information on the
    // structure of BIND configuration files in Debian, *BEFORE* you customize
    // this configuration file.
    //
    // If you are just adding zones, please do that in /etc/bind/named.conf.local

    include "/etc/bind/named.conf.options";
    include "/etc/bind/named.conf.local";
    include "/etc/bind/named.conf.default-zones";

    zone "siec" {
    type master;
    file "/etc/bind/siec";
    };

    zone "10.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/siec.rev";
    };


    Plik siec:
    Cytat:
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 604800
    @ IN SOA siec. root.siec. (
    050920122 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    @ IN NS ns1.siec.
    ns1 IN A 192.168.10.1
    www IN A 192.168.10.1
    siec IN A 192.168.10.1


    Plik siec.rev:
    Cytat:
    $TTL 604800
    @ IN SOA 10.168.192.in-addr.arpa. root.siec. (
    050920123 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    @ IN NS ns1.siec.
    1 IN PTR ns1.siec.
    www IN A 192.168.10.1
  • REKLAMA
  • #2 16771254
    szwagros
    Poziom 33  
    Posty: 1844
    Pomógł: 232
    Ocena: 271
    Jakie systemy na serwerze i stacjach?
  • REKLAMA
  • #3 16771473
    marek_kkk
    Poziom 13  
    Posty: 152
    Pomógł: 1
    Ocena: 17
    Serwer - Linux Debian Stretch
    Stacje klienckie - Windows 7, 10
  • REKLAMA
  • #4 16771479
    szwagros
    Poziom 33  
    Posty: 1844
    Pomógł: 232
    Ocena: 271
    Windows nie lubi jak domena jest 'jednoczłonowa' - bez kropki.
    Zmień nazwę na np siec.local
  • #5 16775771
    marek_kkk
    Poziom 13  
    Posty: 152
    Pomógł: 1
    Ocena: 17
    szwagros napisał:
    Zmień nazwę na np siec.local


    załatwiło sprawę.

    Dzięki
    pozdrawiam
REKLAMA