Δημοσιεύτηκε: 11 Μαρ 2017, 18:41
από pc_magas
Στην εργασία μου έχουμε ένα subdomain names που δεν είναι διαθέσιμα στο ευρύ κοινό παρά μόνον εντός του εταιρικού τοπικού δικτύου. Πχ το site και γενικά οι public υπηρεσίες της εταιρείας χρησιμοποιούν το examle.com και οι lan υπηρεσίες χρησιμοποιούν subdomains όπως crm.intranet.example.com, fileshare.intranet.example.com κλπ κλπ μέσω ενός εσωτερικού DNS server.

Έτσι και εγώ έστησα ένα εικονικό δίκτυο με την χρήση Virtualbox Vms:



Στο Lubuntu vm έστησα ακόμη και έναν bind9 DNS Server με τις εξής ρυθμίσεις:

  • named.conf:
    Κώδικας: Επιλογή όλων
    // 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";
  • named.conf.local
    Κώδικας: Επιλογή όλων
    options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk. See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable
    // nameservers, you probably want to use them as forwarders.
    // Uncomment the following block, and insert the addresses replacing
    // the all-0's placeholder.

    forwarders {
    208.67.222.222;
    208.67.220.220;
    };

    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys. See https://www.isc.org/bind-keys
    //========================================================================
    dnssec-validation auto;

    auth-nxdomain no; # conform to RFC1035
    listen-on-v6 { any; };
    };

    acl "intranet" { 10.42.0.0/24; };
    view "intranetView" {
    match-clients { "intranet"; };
    recursion yes;
    zone "intranet.example.com" {
    type master;
    file "/etc/bind/db.intranet";
    };
    include "/etc/bind/named.conf.default-zones";
    };

    view "outside" {
    match-clients { any; };
    recursion no;
    include "/etc/bind/named.conf.default-zones";
    };
  • Και όπως βλέπετε παραπάνω την ζώνη intranet.example.com στο αρχείο db.intranet:
    Κώδικας: Επιλογή όλων

    $TTL 604800
    @ IN SOA intranet.example.com. (
    2 ; Serial
    604801 ; Refresh
    86400 ; Retry
    241 ; Expire
    604801 ) ; Negative Cache TTL
    ;
    @ IN A 10.42.0.1
    app1 IN A 10.42.0.1
    app2 IN A 10.42.0.1

Δε το Lubuntu Vm έχει και τα εξής interfaces
Κώδικας: Επιλογή όλων
eth0 Link encap:Ethernet HWaddr 08:00:27:c5:2f:47
inet addr:192.168.2.4 Bcast:192.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::a00:27ff:fec5:2f47/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1889 errors:0 dropped:0 overruns:0 frame:0
TX packets:3842 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:555806 (555.8 KB) TX bytes:270148 (270.1 KB)

eth1 Link encap:Ethernet HWaddr 08:00:27:6a:78:cb
inet addr:10.42.0.1 Bcast:10.42.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6a:78cb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:745 errors:0 dropped:0 overruns:0 frame:0
TX packets:545 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60898 (60.8 KB) TX bytes:46209 (46.2 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1333 errors:0 dropped:0 overruns:0 frame:0
TX packets:1333 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:115044 (115.0 KB) TX bytes:115044 (115.0 KB)


Όμως όταν μπαίνω στο σε ένα VM και προσπαθώ να κάνω ping το intranet.example.com λαμβάνω:


Όμως μπορεί και κάνε resolve το google.com.

Έχετε ιδέα πως να το λύσω.
Ακόμη για την εφαρμογή αυτή μήπωςε θέλω και δεύτερο network interface στο Lubuntu vm μου;