#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    General DNS Questions


    Hi,
    New here.

    I have an EC2 instance with an electric ip assigned.

    I have installed virtualmin using the auto install.

    The goal: to set up several virtual server websites using virtualmin on ec2.

    Now the DNS questions

    When I run a check on the installation two problems are noted:
    The interface is getting its ip from dhcp.
    And apparently I need to add 127.0.0.1 to the DNS list because the system is configured to host DNS via BIND.

    Can this instance, which has the elastic ip assigned, also be its own name server or does the name server need a separate ip?

    I have a domain and have registered it as ns1.domain.com with the registrar. Assuming The instance can indeed be its own Nameserver, how do I set that up?

    Thanks! You are much appreciated for dealing with a newbie
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    289
    Rep Power
    44
    What is EC2?
    What is an electric ip/elastic ip?

    based on the fact that you mentioned DHCP, do you mean Dynamic IP? If so, providing DNS service on a Dynamic IP address is not advisable.

    J.A. Coutts
  4. #3
  5. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,535
    Rep Power
    1906
    Originally Posted by dwest100
    The interface is getting its ip from dhcp.
    And apparently I need to add 127.0.0.1 to the DNS list because the system is configured to host DNS via BIND.
    That is not the IP you should add to DNS.
    127.0.0.1 is a system IP which point to its own (local) system.

    The system should have another IP, starting with 10, 172 or 192.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Location
    Oklahoma
    Posts
    11
    Rep Power
    0
    Okay basically there are some ipv4 rules and it sounds like you are about to break one.

    There are some reserved ip's for the purpose of local network and loop back.

    127.0.0.0/8 is a class A IP address
    10.0.0.0/8 Class A local network
    192.168.0.0/16 Cass B network for local network

    Those are the 3 most common IP Subnets. Each machine on a network is going to have a loopback IP which is 127.0.0.1 typical and is used to communicate with it's self. it will also have another IP which most likely a local IP 192.168.x.x.

    On your machine assuming your using Linux based try

    # ifconfig -a

    This will give you some information,
    lo will be your loop back device.
    eth0 is typically your network card

    What distribution are you using? Debain, Ubuntu, Centos, etc?

    Now as for setting up your DNS it really sounds like you need to go back to the basics.

    But however I guess you can to start somewhere. Try googling configuring bind.

    You'll have a base configuration and then you need to add a zone file and zone records.

    Usually in /etc/named.conf on RHET Based distros you'll need to add a zone file in it.

    Code:
    zone "domain.com" {
            type master;
            file "/var/named/domain.com.db";
    };
    then youn need to create that file /var/named/domain.com.db and add a few records

    Code:
    $TTL 14400
    domain.com.  86400   IN      SOA     ns1.domain.com.    webmaster.domain.com.        (
                                                    2013100107 ;Serial Number
                                                    86400 ;refresh
                                                    7200 ;retry
                                                    2419200 ;expire
                                                    86400 ;minimum
            )
    domain.com.  86400   IN      NS      ns1.domain.com.
    domain.com.  86400   IN      NS      ns2.domain.com.
    domain.com.  14400   IN      A       192.168.x.x
    localhost       14400   IN      A       127.0.0.1
    domain.com.  14400   IN      MX      0       mail.domain.com.
    mail    14400   IN      A       192.168.x.x
    www     14400   IN      CNAME   domain.com.
    ns1     14400   IN      A       192.168.x.x
    ns2     14400   IN      A       192.168.x.x
    notice after every fully qualified domain there is a <.> at the end of it. That tells bind that is the full domain. notice on ns1 and ns2 there is no <.>. that is telling bind that it appends to the zone record domain.com

    There is quite a bit involved and you will need to do alot of research.

IMN logo majestic logo threadwatch logo seochat tools logo