Linux Basics

  • Yoda
  • Beginner
  • Beginner
  • Yoda
  • Posts: 58

Post 3+ Months Ago

Dear all,

I am pretty new to Linux but need some assistance if you can possibly assist. I am currently building a new database for my school, and would like to know how about linking up our (LAMP) database with an external domain name such as intranet so that our staff do not have to type in the ip address. Is there anyway to do this on Linux? Do we have to purchase a domain name from a hosting provider to this?

Yoda
  • CodyRo
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: California

Post 3+ Months Ago

You can get a free domain / FreeDNS type service to make something easy to remmember (http://www.freedns.com). You could also get a domain if you like, it will only cost you about $10.00~ a year.

-Cody
  • Yoda
  • Beginner
  • Beginner
  • Yoda
  • Posts: 58

Post 3+ Months Ago

Thanks Cody for the feedback. However, I want to use the domain only as an Intranet. Is this possible to do if I purchase the domain name?

Thanks in advance.

Yoda
  • CodyRo
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: California

Post 3+ Months Ago

Yes, you could have it forward to the internal IP etc etc..
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

You can set up an internal domain name server. Setup and configuration are exactly as you would with a normal domain name server except that it has a private address (192.168.xxx.xxx or 10.xxx.xxx.xxx).

Once you've set up this name server, you can assign names to addresses with it as you would any other name server and then set your local clients to use that as a primary DNS server and set your current primary as secondary.

Hope that made sense. Check the the bind website for more info than you'll ever need.
  • Yoda
  • Beginner
  • Beginner
  • Yoda
  • Posts: 58

Post 3+ Months Ago

Dear this213,

Thanks for the feedback. However, is it possible for you to give me a step-by-step instruction on how to go about setting up the DNS on a Linux Server. I am pretty new to Linux so I do not want to mess things up on the server.

Any step-by-step help that you can possibly give me would be appreciated.

Yoda
  • Yoda
  • Beginner
  • Beginner
  • Yoda
  • Posts: 58

Post 3+ Months Ago

this213,

Let us say that I purchase a domain name such as xxx.com from a domain name registrar. Can I then go to the admin control panel of the domain name registrar and input the internal ip primary and secondary address for that purchased domain name? Also, I am interested in purchasing a SSL certificate for the server as well. Would that be possible to do on the Linux after I set up the internal domain name?

Yoda
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

No, you don't need to purchase a domain name for internal use. The internal domain name can be anything you desire and doesn't have to end in .com, .net, .org or any of those. Your internal network will work identically with a name such as mynetwork, thisnet, mydom or whatever else you can come up with.

For internal use, you would use self signed SSL certificates.

I can't give you step by step instructions without knowing what distribution you're running. However, generally speaking you would install bind, then add your forward and reverse zones to your /etc/named.conf, then create your zone files under /var/named/ (or /var/named/chroot/var/named/ if your system provides that).

So, generically, you would add something like this to your /etc/named.conf:
Code: [ Select ]
zone "0.168.192.in-addr.arpa" IN {
    type master;
    file "0.168.192.in-addr.arpa.zone";
};

zone "mydomain" IN {
    type master;
    file "mydomain.zone";
    notify no;
};
  1. zone "0.168.192.in-addr.arpa" IN {
  2.     type master;
  3.     file "0.168.192.in-addr.arpa.zone";
  4. };
  5. zone "mydomain" IN {
  6.     type master;
  7.     file "mydomain.zone";
  8.     notify no;
  9. };

This merely defines what zones are in this nameserver's control and points to the configuration file to use for those zones.

Given these zones, you might make your reverse map look something like this:
/var/named/0.168.192.in-addr.arpa.zone
Code: [ Select ]
$TTL 86400
@    IN    SOA    ns1.mydomain.    root.mydomain. (
            2004091203 ; serial
            28800 ; refresh
            7200 ; retry
            604800 ; expire    
            86400 ; ttk
            )


@    IN    NS    ns1.mydomain.

1    IN    PTR        ns1.mydomain.
2    IN    PTR        ns2.mydomain.
3    IN    PTR        mail.mydomain.
4    IN    PTR        www.mydomain.
5    IN    PTR        www_dev.mydomain.
  1. $TTL 86400
  2. @    IN    SOA    ns1.mydomain.    root.mydomain. (
  3.             2004091203 ; serial
  4.             28800 ; refresh
  5.             7200 ; retry
  6.             604800 ; expire    
  7.             86400 ; ttk
  8.             )
  9. @    IN    NS    ns1.mydomain.
  10. 1    IN    PTR        ns1.mydomain.
  11. 2    IN    PTR        ns2.mydomain.
  12. 3    IN    PTR        mail.mydomain.
  13. 4    IN    PTR        www.mydomain.
  14. 5    IN    PTR        www_dev.mydomain.

Basically, this defines where to find the named sytems in the 192.168.0 network. So, 192.168.0.1 is ns1.mydomain, 192.168.0.2 is ns2.mydomain, 192.168.0.3 is mail.mydomain and so on.

You then need a forward zone map for each zone, which might look like this:
/var/named/mydomain.zone
Code: [ Select ]
$TTL 86400
@    IN    SOA    ns1.mydomain. root.mydomain. (
            2006031405; serial
            7200 ; refresh
            1800 ; retry
            1209600 ; expire    
            86400 ; ttl
            )


    IN    NS    ns1.mydomain.
    IN    NS    ns2.mydomain.

@  IN    MX    1    mail.mydomain.
    IN    TXT    "v=spf1 A MX -ALL"

             IN    A    192.168.0.4
@            IN    A    192.168.0.4
www          IN    A    192.168.0.4
www_dev         IN    A    192.168.0.5
mail            IN    A    192.168.0.3
ns1            IN    A    192.168.0.1
ns2            IN    A    192.168.0.2
  1. $TTL 86400
  2. @    IN    SOA    ns1.mydomain. root.mydomain. (
  3.             2006031405; serial
  4.             7200 ; refresh
  5.             1800 ; retry
  6.             1209600 ; expire    
  7.             86400 ; ttl
  8.             )
  9.     IN    NS    ns1.mydomain.
  10.     IN    NS    ns2.mydomain.
  11. @  IN    MX    1    mail.mydomain.
  12.     IN    TXT    "v=spf1 A MX -ALL"
  13.              IN    A    192.168.0.4
  14. @            IN    A    192.168.0.4
  15. www          IN    A    192.168.0.4
  16. www_dev         IN    A    192.168.0.5
  17. mail            IN    A    192.168.0.3
  18. ns1            IN    A    192.168.0.1
  19. ns2            IN    A    192.168.0.2

The layout of this file should be fairly self explanitory. Define your nameservers, give addresses to all the clients you want to control through this. Be sure that if you're assigning static IPs to hosts within a DHCP server's range, you'll need to set up exclusions for that host in your DHCP server.
  • Yoda
  • Beginner
  • Beginner
  • Yoda
  • Posts: 58

Post 3+ Months Ago

Thanks this213. I will try performing these functions as you suggested. However, since I am new to Linux I may need some additional help.

With this being said, we are running Linux Enterprise version 4.3, I believe.

Yoda
  • Yoda
  • Beginner
  • Beginner
  • Yoda
  • Posts: 58

Post 3+ Months Ago

this213 - the ip address that we would use to access files on the server would be 192.168.0.x. Is there anything different in the /etc/name.conf file that we would need to change beyond the instructions you have already given us?

Yoda
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

If you're using a 192.168.0.x domain, you can literally use the exact formats I posted and just change the names to match.

I should point out though that I did make an error in the listings I posted, you can't have names with underscores in them, so www_dev would make the server fail with a bad_name error for that domain. Sorry, I just realized what I had posted.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 102 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.