LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-18-2013, 05:11 AM   #1
BuhRock
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Rep: Reputation: 0
Adding clients to DNS


So I got bind set up, and when I do a "dig logic.bs" I can confirm it was set up. So say I have a computer called client1 with an ip of 192.168.153.128.

Here is my named.conf.local:
Code:
//include "/etc/bind/zones.rfc1918";
# This is the zone definition. replace example.com with your domain name
zone "logic.bs" {
        type master;
        file "/etc/bind/zones/logic.bs.db";
        };

# This is the zone definition for reverse DNS. replace 0.168.192 with your netw$
zone "153.168.192.in-addr.arpa" {
     type master;
     file "/etc/bind/zones/rev.153.168.192.in-addr.arpa";
};
Here is my rev.153.168.192.in-addr-rarp file

Code:
@ IN SOA ns1.logic.bs. admin.logic.bs. (
                        2006081401;
                        28800;
                        604800;
                        604800;
                        86400
)

                     IN    NS     ns1.logic.bs.
1                    IN    PTR    logic.bs
I add in my /zones/logic.bs.db file,

Code:
logic.bs.      IN      SOA     ns1.logic.bs. admin.logic.bs. (
// Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
 )

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com.      IN      NS              ns1.logic.bs.
example.com.      IN      MX     10       client1.logic.bs.

// Replace the IP address with the right IP addresses.
client1              IN      A       192.168.153.128
ns1              IN      A       192.168.153.254
Where ns1 is the DNS server and IP of the computer and the client1 is the one mentioned above. If I do a nslookup client1, then it can't find it. If I ping client1.logic.bs, same thing. What am I doing wrong?

Last edited by BuhRock; 05-18-2013 at 05:37 AM.
 
Old 05-18-2013, 11:02 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Where ns1 is the DNS server and IP of the computer and the client1 is the one mentioned above. If I do a nslookup client1, then it can't find it. If I ping client1.logic.bs, same thing. What am I doing wrong?
Your config look good. Does the following works?
Code:
nslookup client1.logic.bs
If yes, then add a
Code:
domain logic.bs
in /etc/resolv.conf

Regards
 
Old 05-18-2013, 02:09 PM   #3
BuhRock
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Original Poster
Rep: Reputation: 0
I edited my logic.bs.db file to this:

Code:
logic.bs.      IN      SOA     ns1.logic.bs. admin.logic.bs. (
// Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
 )

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
logic.bs.      IN      NS              ns1.logic.bs.
logic.bs.      IN      MX     10       client1.logic.bs.

// Replace the IP address with the right IP addresses.
client1              IN      A       192.168.153.128
server              IN      A       192.168.153.254
s1                 CNAME           server
And also edited the reverse file to this:

Code:
@               IN              SOA      www..logic.bs. admin.logic.bs. (
                        2006081401;
                        28800;
                        604800;
                        604800;
                        86400
)
                                NS      ns1.logic.bs

128                    IN    PTR    client1.logic.bs
254                    IN    PTR    server.logic.bs

When I do a nslookup client1.logic.bs it says it can't be found.

I added this int he named.conf.options:
Code:
listen-on port 53 { 127.0.0.1; };


listen-on port 53 { any; };
In my /etc/resolv.conf, should I have nameserver 127.0.0.1 ?

And when I dig logic.bs, should I be getting
SERVER: 127.0.0.1#53(127.0.0.1) because I was getting my 192.168.153.254 address before...

Last edited by BuhRock; 05-18-2013 at 02:11 PM.
 
Old 05-18-2013, 04:43 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Please note that you should increase the serial number every time you change the zone file. So increase 2006081401 to 2006081402 and reload bind.
Also note that you have
Quote:
s1 CNAME server
I guess it's a typo and you meant ns1 instead of s1
Quote:
I added this int he named.conf.options:
Code:

listen-on port 53 { 127.0.0.1; };


listen-on port 53 { any; };

In my /etc/resolv.conf, should I have nameserver 127.0.0.1 ?

And when I dig logic.bs, should I be getting
SERVER: 127.0.0.1#53(127.0.0.1) because I was getting my 192.168.153.254 address before...
You should leave just
Code:
listen-on port 53 { any; };
The resolv.conf of the server is fine with 127.0.0.1. In the client(s) resolv.conf you should use "nameserver 192.168.153.254". And since you're using 127.0.0.1as a resolver, then the dig output is correct.

Regards
 
Old 05-18-2013, 06:27 PM   #5
BuhRock
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks so much for the reply. I'm still not able to do a nslookup of client1.logic.bs

Code:
root@Server:/etc/bind# nslookup client1.logic.bs
Server:		127.0.0.1
Address:	127.0.0.1#53

** server can't find client1.logic.bs: SERVFAIL
 
Old 05-19-2013, 02:25 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
** server can't find client1.logic.bs: SERVFAIL
SERVFAIL means that you have an error in the zone file, or in the config file(s). After using named-checkzone with your zone file, I've found a couple of errors, like the CNAME for the NS that is illegal, the // for comment lines and so on. You can try to use the following instead, after adjusting the serial number
Code:
$TTL 86400
logic.bs.      IN      SOA     ns1.logic.bs. admin.logic.bs. (
; Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
 )

; Replace the following line as necessary:
; ns1 = DNS Server name
; mta = mail server name
; example.com = domain name
logic.bs.      IN      NS              ns1.logic.bs.
logic.bs.      IN      MX     10       client1.logic.bs.

; Replace the IP address with the right IP addresses.
client1              IN      A       192.168.153.128
server              IN      A       192.168.153.254
ns1                  IN      A   192.168.153.254
Also note that in the reverse zone you miss the trailing dots in the 2 RRs. They should be
Code:
128                    IN    PTR    client1.logic.bs.
254                    IN    PTR    server.logic.bs.
 
1 members found this post helpful.
Old 05-24-2013, 07:05 PM   #7
BuhRock
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Ok thanks, I got it to work. I got it to work with windows clients as well. Is this what you have to do if you had a bigger network and about 100 machines? Would you have to put in 100 lines in the config file?
 
Old 05-25-2013, 12:39 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by BuhRock View Post
Ok thanks, I got it to work. I got it to work with windows clients as well. Is this what you have to do if you had a bigger network and about 100 machines? Would you have to put in 100 lines in the config file?
You can use dhcp and dynamic dns updates (ddns).
There are lots of tutorials on the net about that, so you should search for a guide that matches your distro and other needs.

Regards
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding VPN clients on a Linux 10.4 shareserver 2Daves Linux - Server 0 03-14-2012 11:08 AM
adding more users in LDAP servers and clients amit11rhce Linux - Server 1 03-18-2011 05:26 AM
How to get Windows Clients to be served DNS from a Linux BIND-DNS Server texmansru47 Linux - Networking 12 07-10-2008 07:06 PM
DNS Server: WinXP DNS clients losing name resolution frequently loopy69 Linux - Server 4 03-27-2007 09:21 PM
DHCPD-3 not adding DNS entries for Linux clients mobiusNZ Linux - Networking 2 03-11-2007 08:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration