The wikis are now using the new authentication system.
If you did not migrate your account yet, visit https://idp-portal-info.suse.com/

Suse 10.0 DNS server

Şuraya atla: kullan, ara

Suse 10.0 DNS server

What is the Domain Name System(DNS? The DNS is the glue that keeps the Internet together. DNS translates domain name(example.com) to an IP address and vice versa. It's much easier for us to remember names than numbers.

DNS is defined in Request for Comments (RFCs) 1034 and 1035.

Basically, any major Linux distro can be used as a DNS, Web, E-mail, and FTP server, and Suse is not an exception. All in one box and one static IP address. That's all you need! Of course, I am talking about an experimental machine. An educative aproach. If you are seriuos about the Internet, you are going to need minimun two DNS servers, an email server, a web server, an FTP server, a firewall machine may be using ipcop.org, a proxy server, etc.

The DNS server is very easy to install. All you need to install is the BIND package, modified the /etc/named.conf file, and create your own zones files.

If you are using any type of firewall, keep port 53 open for UDP and TCP. This is the port dedicated to DNS.


Edit /etc/named.conf and add your reference zone files. Right after the first reference zone file, in this case zone "0..0.127.in-addr.arpa", add yours, in my case I added two zone references: enicaragua.net and sixbone.com. Pay close attention to the open and close braces, quotes, and semicolons.

zone "0.0.127.in-addr.arpa" in {
        type master;
        file "127.0.0.zone";
};

zone "enicaragua.net" in {
        type master;
        file "enicaragua.zone";

};

zone "sixbone.com" in {
        type master;
        file "sixbone.zone";
};
:

Zones files

Suse puts the named dir in /var/lib/named. Here is where your zones file will be located. This is the sixbone.com domain's zone file:

unix:/home/ipv6 # more /var/lib/named/sixbone.zone
; DNS record for the sixbone.com domain
$TTL 86400      ; max TTL
$ORIGIN sixbone.com.
@       IN      SOA     unix.sixbone.com. root.sixbone.com. (
                        2003021401
                        28800
                        7200
                        604800
                        3600 )
@               IN      A       68.183.62.111
@               IN      NS      unix.sixbone.com.
@               IN      MX      10      unix.sixbone.com.
www             IN      CNAME   sixbone.com.
                IN      CNAME   sixbone.com.
unix:/home/ipv6 #

Now, we need to test the zone files, so we type: rndc reload, next we run rcnamed start. You should get not erros. Next type rcnamed status, you should see the number of zones running, and the last line will say the server is up and running.

If you get an error, check braces, quotes, and semicolos in /etc/named.conf.


If you want to know more about CNAME, A, NS, etc. Read The DNS & Bind Book

Have you seen those sites that if you don't put the www, you cannot get to it? Well, it's all in the zone files. If you check the sixbone.com file, you see one reference with the www and one reference without it, these are called CNAME or alias. Bingo! By the same token, you create the same way an FTP server, so on and so forth. In the case of a Web server, you need to check your Apache conf files, and make sure that you create your virtual hosts reference as well. This is another topic. Finally, I run the last check using dig, your DNS friend, and this is what I get:

unix:/home/ipv6 # dig sixbone.com

; <<>> DiG 9.3.1 <<>> sixbone.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55238
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;sixbone.com.                   IN      A

;; ANSWER SECTION:
sixbone.com.            86194   IN      A       68.183.62.111

;; AUTHORITY SECTION:
sixbone.com.            86194   IN      NS      unix.sixbone.com.

;; Query time: 34 msec
;; SERVER: 66.51.205.100#53(66.51.205.100)
;; WHEN: Thu Jan 13 03:27:51 2005
;; MSG SIZE  rcvd: 64

unix:/home/ipv6 #

DNS is an exciting topic, and these few lines don't even put a dent to it. For example, you need to register your own domain name with a domain name service provider. i.e ns.com, buydomains.com, etc. By creating these zone files in your server, your DNS server is not going to work, I mean, it won't resolve any domain name at all, may be locally.

How the DNS work? Here is a link that explain very well how it works: How DNS works Each domain name must have two DNS servers. Some people named their ns1.example.com and ns2,example,com, in my case I named mine unix.sixbone.com unix is the name of the machine itself, or host name in the UNIX jargon. The first reference in the link above, is the root level. These are a series of machines, 13 total to be exact, distributed around the world. I think Japan has two, Europe has a couple more, the US has the most, etc.

What are the names of these machines? In your /var/lib/named there is a file called root.hint, this file contain the list of the these machines. Here is the file in my Linux box:

unix:/home/ipv6 # more /var/lib/named/root.hint
;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  "
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    Jan 29, 2004
;       related version of root zone:   2004012900
;
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
;
; formerly C.PSI.NET
;
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; operated by VeriSign, Inc.
;
.                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
;
; operated by RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
;
; operated by ICANN
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; operated by WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File

The last machine listed in this root.hint file is locates in Paris, France. Just use visualroute.com to find the rest.

Keep in mind that we are "inserting" a machine to the biggest network of the world: The Internet. And this machine must be capable to let everybody know regardless where they are how to find example.com, how to find this domain name and its contents. For a small local network, you don't need a DNS server, you can use the first approach since the ARPANET's days of resolving names to IP addresses: the hosts file located in /etc/hosts


--Raxxal 18:46, 13 Jan 2006 (MST)