DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd May 2008
c0mrade's Avatar
c0mrade c0mrade is offline
Port Guard
 
Join Date: May 2008
Posts: 41
Thanked 0 Times in 0 Posts
Default nameservers

Hello all,

I stumbled upon this tutorial http://www.howtoforge.com/linux_bind...ing_nameserver (sorry not trying to spam) . I was reading it and really explains how to things step by step, but still I have a problem with configuring nameservers so I came here to ask for help.
I'm trying to figure out the way to make nameservers for domain name "komentari.info" on vps I rented for testing. In order to update nameservers of this domain I should create ones on this vps machine rite.. like ns1 and ns2 or whatever.. the thing is that I add these ns1.komentari.info inside /etc/named.conf inside file it points to /var/zone/named/ns1.komentari.info.zone. I also add httpd.conf inside <Virtualhost> .. and yet I don't manage to change domains nameservers .. I've bought this domain at key-systems.de (sorry if this is spam) and it doesn't allow me to update nameservers because they don't quite exist .. I've been reading a lot to get an idea how DNS works and I'm pretty much there just I'm missing something. Can you guys help me, which file/s should I edit .. or if I'm doing something wrong to start with can someone put me in the right direction? I've been googling but this tutorial is the best I could find for this type of setup ..
Thank you in advance
Reply With Quote
  #2   (View Single Post)  
Old 23rd May 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Are you sure this link works? I'm getting a 404 page not found error.
Reply With Quote
  #3   (View Single Post)  
Old 23rd May 2008
c0mrade's Avatar
c0mrade c0mrade is offline
Port Guard
 
Join Date: May 2008
Posts: 41
Thanked 0 Times in 0 Posts
Default

Don't know why it didn't paste the whole link.. here it is then http://www.howtoforge.com/linux_bind...ing_nameserver
Reply With Quote
  #4   (View Single Post)  
Old 23rd May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,154
Thanked 182 Times in 149 Posts
Default

Without showing any configuration file it is very difficult to help you
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 24th May 2008
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Thanked 35 Times in 31 Posts
Default

I created a little how-to on crafting Redundant Caching-only DNS servers in OpenBSD. It uses CARP, but the named.conf listed could be used independent of any CARP configuration on the servers.

It's listed at this site, but I will create a guide for this here very shortly. Until then, hope that guide (which may even be slightly incomplete) guides you in the right direction.
__________________
Network Firefighter
Reply With Quote
  #6   (View Single Post)  
Old 25th May 2008
c0mrade's Avatar
c0mrade c0mrade is offline
Port Guard
 
Join Date: May 2008
Posts: 41
Thanked 0 Times in 0 Posts
Red face

Thank you for your answers .. here are some configuration files I will start with /etc/httpd/conf/httpd.conf using this turtorial

Its pretty big file I can't post it.. so I'll tell you what I added/edited in here ..
LINE 133 - Replaced Listen 80 with Listen 208.84.149.210:80 since this is server main ip
LINE 251 - Replaced ServerAdmin root@localhost with ServerAdmin hexteam@gmail.com
LINE 266 - Added ServerName 208.84.149.210
LINE 973 - Added NameVirtualHost panel.komentari.info:80
Now I added one virtual hostname record
LINE 985 - <VirtualHost panel.komentari.info:80>
LINE 986 - ServerAdmin hexteam@gmail.com
LINE 987 - ServerName 208.84.149.210
LINE 988 - DocumentRoot /www
LINE 989 - ErrorLog logs/error_log
LINE 990 - CustomLog logs/access_log combined
LINE 991 - </VirtualHost>
I also added include file so my httpd.conf wouldn't get too big and I can't handle all records inside so I added
LINE 992 - Include conf/vhosts/*.conf and created dir named vhosts
--------------------------------------------------------------------
This is what I get with httpd -S

Code:
 httpd -S
[Sun May 25 15:57:22 2008] [error] (EAI 2)Name or service not known: Could not resolve host name panel.komentari.info -- ignoring!
[Sun May 25 15:57:23 2008] [error] (EAI 2)Name or service not known: Could not resolve host name panel.komentari.info -- ignoring!
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443          208.84.149.210 (/etc/httpd/conf.d/ssl.conf:81)
Syntax OK
And apache is working ok you can check that from your browser 208.84.149.210

What I did next was cd /etc/httpd/conf/vhosts and added 2 files :
1st one was ns1.komentari.info.80.conf with this content
Code:
<VirtualHost ns1.komentari.info:80>
    ServerAdmin hexteam@gmail.com
    ServerName  208.84.149.210
    ServerAlias www.ns1.komentari.info
</VirtualHost>
2nd one named ns2.komentari.info.80.conf with this content changing ServerName with my secondary server ip ..
Code:
<VirtualHost ns2.komentari.info:80>
    ServerAdmin hexteam@gmail.com
    ServerName  208.84.151.35
    ServerAlias www.ns2.komentari.info
</VirtualHost>
Then I restarted Apache service httpd restart got this
Code:
service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: [Sun May 25 16:09:50 2008] [error] (EAI 2)Name or service not known: Could not resolve host name panel.komentari.info -- ignoring!
[Sun May 25 16:09:51 2008] [error] (EAI 2)Name or service not known: Could not resolve host name panel.komentari.info -- ignoring!
[Sun May 25 16:09:51 2008] [error] (EAI 2)Name or service not known: Could not resolve host name ns1.komentari.info -- ignoring!
[Sun May 25 16:09:52 2008] [error] (EAI 2)Name or service not known: Could not resolve host name ns2.komentari.info -- ignoring!
                                                           [  OK  ]
For now what I wanted to do is to create some virtual hosts for my domain komentari.info .. problem is following error from my domain register "541 Invalid attribute value; nameserver "ns1.komentari.info" does not exist" and they won't update the nameservers of this domain.. so I'm again at point zero.. so I moved onto next tutorial I found this one
is about making cached nameservers .. I'm still a noob on this topic I've been reading a lot and have some expirience with several control panels but never tried to configure this on my own .. so I did next

According to this tutorial there should be file /etc/named.conf but in this version of centos 5 there are slightly different 2 files, one particularly similar to named.conf mentioned in tutorial so what I did I copied named.rfc1912.zones to named.conf and added
Code:
zone "panel.komentari.info" IN {
        type master;
        file "/var/named/panel.komentari.info.zone";
        allow-update { none; };
};

zone "ns1.komentari.info" IN {
        type master;
        file "/var/named/ns1.komentari.info.zone";
        allow-update { none; };
};

zone "ns2.komentari.info" IN {
        type master;
        file "/var/named/ns1.komentari.info.zone";
        allow-update { none; };
};
to make zone for hostname and nameservers ..

then I started named service named start it failed at first because I didn't have files created inside /var/named .. after creating all 3 files started editing
/var/named/panel.komentari.info.zone here is its content
Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           ns1.komentari.info.
                IN NS           ns2.komentari.info.

panel.komentari.info. IN A 208.84.149.210

localhost.panel.komentari.info. IN A 127.0.0.1
Then I created ns1.komentari.info.zone with this content
Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           ns1.komentari.info.
                IN NS           ns2.komentari.info.

ns1.komentari.info. IN A 208.84.149.210

localhost.ns1.komentari.info. IN A 127.0.0.1
And last file ns2.komentari.info.zone has this content
Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           ns1.komentari.info.
                IN NS           ns2.komentari.info.

ns2.komentari.info. IN A 208.84.151.35

localhost.ns2.komentari.info. IN A 127.0.0.1
At this point I noted I forgot to add my main domain name "komentari.info" to these conf. files so I added one record inside named.conf created file inside /var/named with familiar content .. and of course created /etc/httpd/conf/vhosts/komentari.info.80.conf sorry for these backwards steps I've memorized them all and yet I can't figure out the way to get this working .. Now I'm editing file resolv.conf and it looks like this now..
Code:
nameserver 208.77.101.249
nameserver 208.77.101.48
nameserver 208.77.98.215
now I'm not sure whether I should delete these lines or leave them thats why I will just update this file by adding two lines .. Then I went inside vi /etc/sysconfig/network and changed hostname to HOSTNAME="panel.komentari.info" and now tried to start named and it wont start obviously I'm doing something wrong here .. this is ls -la inside /var/named/
Code:
 ls -la
total 36
drwxr-x---  5 root  named 4096 May 25 16:41 .
drwxr-xr-x 21 root  root  4096 Dec 31 03:46 ..
drwxr-x---  6 root  named 4096 May 25 16:24 chroot
drwxrwx---  2 named named 4096 Nov 10  2007 data
-rw-r--r--  1 root  root   581 May 25 16:41 komentari.info.zone
lrwxrwxrwx  1 root  named   45 May 25 08:03 localdomain.zone -> /var/named/chroot//var/named/localdomain.zone
lrwxrwxrwx  1 root  named   43 May 25 08:03 localhost.zone -> /var/named/chroot//var/named/localhost.zone
lrwxrwxrwx  1 root  named   44 May 25 08:03 named.broadcast -> /var/named/chroot//var/named/named.broadcast
lrwxrwxrwx  1 root  named   37 May 25 08:03 named.ca -> /var/named/chroot//var/named/named.ca
lrwxrwxrwx  1 root  named   44 May 25 08:03 named.ip6.local -> /var/named/chroot//var/named/named.ip6.local
lrwxrwxrwx  1 root  named   40 May 25 08:03 named.local -> /var/named/chroot//var/named/named.local
lrwxrwxrwx  1 root  named   39 May 25 08:03 named.zero -> /var/named/chroot//var/named/named.zero
-rw-r--r--  1 root  root   589 May 25 16:39 ns1.komentari.info.zone
-rw-r--r--  1 root  root   588 May 25 16:41 ns2.komentari.info.zone
-rw-r--r--  1 root  root   594 May 25 16:38 panel.komentari.info.zone
drwxrwx---  2 named named 4096 Nov 10  2007 slaves
Any suggestions what I did wrong so far ?

Last edited by c0mrade; 26th May 2008 at 12:03 AM.
Reply With Quote
  #7   (View Single Post)  
Old 26th May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,154
Thanked 182 Times in 149 Posts
Default

First get the nameserver setup working

You should use a single file for the komentari.info zone. And if you specify NS records you also should specify the their A records (sometimes called the glue records).

Then test with dig if you can lookup the nameservers
Code:
$ dig -t ns  komentari.info.
If dig returns you the nameservers then use them to do to lookup the address of panel.komentari.info.
Code:
$ dig +norecurse panel.komentari.info @208.84.149.210
Then repeat for the second nameserver
Code:
$ dig +norecurse panel.komentari.info @208.84.151.35
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 26th May 2008
c0mrade's Avatar
c0mrade c0mrade is offline
Port Guard
 
Join Date: May 2008
Posts: 41
Thanked 0 Times in 0 Posts
Default

Thank you for your answer

Quote:
First get the nameserver setup working
- This is my primary goal
I got named working now .. everything running smoothly if you look at conf files... I created komentari.info.zone inside /var/named looks like this
Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           ns1.komentari.info.
                IN NS           ns2.komentari.info.

komentari.info. IN A 208.84.149.210

localhost.komentari.info. IN A 127.0.0.1
I specified A for komentari.info in this file should I specify and how A records of nameservers in this komentari.info.zone file.. if you mean specify A records of nameservers in their zone files I already did that inside /var/named/ns1.komentari.info.zone and in /var/named/ns2.komentari.info.zone

Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           ns1.komentari.info.
                IN NS           ns2.komentari.info.

ns1.komentari.info. IN A 208.84.149.210

localhost.ns1.komentari.info. IN A 127.0.0.1
and
Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           ns1.komentari.info.
                IN NS           ns2.komentari.info.

ns2.komentari.info. IN A 208.84.151.35

localhost.ns2.komentari.info. IN A 127.0.0.1
Now I did dig -t ns komentari.info. this is what I got
Code:
 dig -t ns  komentari.info.

; <<>> DiG 9.3.3rc2 <<>> -t ns komentari.info.
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33124
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;komentari.info.                        IN      NS

;; ANSWER SECTION:
komentari.info.         81260   IN      NS      ns3.dreamhost.com.
komentari.info.         81260   IN      NS      ns2.dreamhost.com.
komentari.info.         81260   IN      NS      ns1.dreamhost.com.

;; Query time: 4 msec
;; SERVER: 208.77.101.249#53(208.77.101.249)
;; WHEN: Sun May 25 17:23:00 2008
;; MSG SIZE  rcvd: 99
Of course this domain shows to old nameservers since I can't change them as mentioned above.. any other hints/tips ? Thank you
Reply With Quote
  #9   (View Single Post)  
Old 27th May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,154
Thanked 182 Times in 149 Posts
Default

You only need one file for the zone komentari.info. In that file you put all hosts in that zone. No, need to use different files
Code:
$TTL    86400
@               IN SOA  @ hexteam.gmail.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                        IN NS   ns1.komentari.info.
                        IN NS   ns2.komentari.info.

ns1                     IN A 208.84.149.210
ns2                     IN A 208.84.151.35

komentari.info.         IN A 208.84.149.210
I entered this file on my OpenBSD workstation and started named. The following command shows it is running/LISTENing
Code:
]netstat -an -f inet
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  192.168.222.20.53      *.*                    LISTEN
tcp        0      0  127.0.0.1.53           *.*                    LISTEN
tcp        0      0  *.6000                 *.*                    LISTEN
tcp        0      0  127.0.0.1.587          *.*                    LISTEN
tcp        0      0  127.0.0.1.25           *.*                    LISTEN
tcp        0      0  *.22                   *.*                    LISTEN
tcp        0      0  *.515                  *.*                    LISTEN
A non-recursive lookup (not starting at the [a-m].root-servers.net] results in the following
Code:
$ dig +norecurse -t ns komentari.info @127.0.0.1

; <<>> DiG 9.3.4 <<>> +norecurse -t ns komentari.info @127.0.0.1
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42956
;; flags: qr aa ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2

;; QUESTION SECTION:
;komentari.info.                        IN      NS

;; ANSWER SECTION:
komentari.info.         86400   IN      NS      ns1.komentari.info.
komentari.info.         86400   IN      NS      ns2.komentari.info.

;; ADDITIONAL SECTION:
ns1.komentari.info.     86400   IN      A       208.84.149.210
ns2.komentari.info.     86400   IN      A       208.84.151.35
A similar lookup for komentari.info
Code:
$ dig +norecurse  komentari.info @127.0.0.1      

; <<>> DiG 9.3.4 <<>> +norecurse komentari.info @127.0.0.1
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47363
;; flags: qr aa ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;komentari.info.                        IN      A

;; ANSWER SECTION:
komentari.info.         86400   IN      A       208.84.149.210

;; AUTHORITY SECTION:
komentari.info.         86400   IN      NS      ns1.komentari.info.
komentari.info.         86400   IN      NS      ns2.komentari.info.

;; ADDITIONAL SECTION:
ns1.komentari.info.     86400   IN      A       208.84.149.210
ns2.komentari.info.     86400   IN      A       208.84.151.35

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue May 27 03:03:42 2008
;; MSG SIZE  rcvd: 116
You should get similar results with dig +norecurse -t ns komentari.info. @208.84.149.210 and dig +norecurse -t ns komentari.info. @208.84.151.35.

With those commands you can check whether the nameserver has been configured correctly.

The next problem is to make non-recursive queries working. In other words, recursive queries starting from the DNS root servers
Code:
]dig -t ns komentari.info.            

; <<>> DiG 9.3.4 <<>> -t ns komentari.info.
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23254
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;komentari.info.                        IN      NS

;; ANSWER SECTION:
komentari.info.         11395   IN      NS      ns1.green-grupa.com.
komentari.info.         11395   IN      NS      ns2.green-grupa.com.

;; Query time: 1 msec
;; SERVER: 192.168.222.10#53(192.168.222.10)
;; WHEN: Tue May 27 03:28:24 2008
;; MSG SIZE  rcvd: 83
This query is answered by by my local recursive nameserver 192.168.222.10.
As you can see it doesn't find yours

You have to contact your registrar for the komentari.info zone and tell him that your nameservers are ns1 and ns2.komentari.info at addresses 208.84.149.210 and 208.84.151.35. They have to enter this information in the nameservers for the *.info top level domain.

After that is done, my and other recursive nameservers will find your nameservers at 208.84.149.210 and 208.84.151.35.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up nameservers paran0iaX OpenBSD General 11 13th March 2009 12:16 PM


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick