DNS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationDNS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2004, 03:40 PM
notinhnotien135 notinhnotien135 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 notinhnotien135 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
DNS server fails to look up itself but able to serve others to surf the web

Hi, all DNS users here. I was trying to setup a local domain with dns and email server. I spent times reading here and there, and some threads here and also the two sticky posts regarding setting up dns and references. I still couldn't firgure out what wrong with my configuration.

I have *.12 (server-small.mygoseals.com) as a mail and dns server, *.8 named viewsonic.mygoseals.com, *.9 named hp.mygoseals.com.

I could point hp and viewsonic to use server-small as dns server and they can surf the web just fine. However, from within server-small I failed to do nslookup such as

nslookup server-small.mygoseals.com

or for the other two. I could do nslookup for outside domain like yahoo.com.

From viewsonic or hp, I failed to ping server-small.mygoseals.com and got unknown host. I could ping using the ip address from these hosts to server-small. I could also ping all hosts from server-small using ip address or like hp.mygoseals.com or just hp.

Please give me some helps because I am really frustrated.

Here is my /etc/hosts

127.0.0.1 localhost
192.168.254.12 server-small.mygoseals.com server-small
192.168.254.8 viewsonic.mygoseals.com viewsonic
192.168.254.9 hp.mygoseals.com hp
-------------------------
my /etc/host.conf

order hosts,bind
multi on
trim mygoseals.com

----------------------------
my /etc/resovl.conf

#default domain
domain mygoseals.com

#default search list
search mygoseals.com

#name server
nameserver 127.0.0.1
nameserver server-small
nameserver 192.168.254.12 #maybe redundant

------------------------------
my /etc/named.conf

options {
directory "/var/named";
forward first; //default

forwarders { //my router and gateway connecting
192.168.254.254; //to my ISP and provides real DNS
};
};

logging{ //copy from this forum
chanel query_logging {
file "/var/log/named/query.log" version 3 size 50M;
print-time yes;
};
category queries {
query_logging;
};
category lame-servers { null; };
};

zone "." IN {
type hint;
file "named.ca";
};

zone "mygoseals.com" IN
{
type master;
file "db.mygoseals";
};

zone "254.168.192.in-addr.arpa" IN
{
type master;
file "db.254.168.192";
};

zone "localhost" IN {
type master;
file "localhost.zone";
//allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
//allow-update { none; };
};
-------------------------------------
my /var/named/db.mygoseals

@ IN SOA server-small.mygoseals.com. steven.mygoseals.com. (
8;
10800;
3600;
604800;
86400);



IN NS server-small.mygoseals.com.
IN MX 5 sever-small

server-small IN A 192.168.254.12
server-small IN MX 5 sever-small

localhost. IN A 127.0.0.1

viewsonic IN A 192.168.254.8
IN MX 5 sever-small

hp IN A 192.168.254.9
IN MX 5 sever-small
---------------------------------------------------
my /var/named/db.254.168.192

@ IN SOA server-small.mygoseals.com. steven.mygoseals.com. (
8;
10800;
3600;
604800;
86400);

IN NS server-small.mygoseals.com.
12 IN PTR server-small.mygoseals.com.

8 IN PTR viewsonic.mygoseals.com.
9 IN PTR hp.mygoseals.com.
--------------------------------------------------

my /var/named/named.local

$TTL 86400
@ IN SOA server-small.mygoseals.com. steven.mygoseals.com. (
8;
10800;
3600;
604800;
86400);

IN NS server-small.mygoseals.com.

1 IN PTR localhost.
1 IN PTR sever-small.
12 IN PTR sever-small.

8 IN PTR viewsonic.
9 IN PTR hp.
--------------------------------
my /var/named/localhost.zone

$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root (
8 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

1D IN NS @
1D IN A 127.0.0.1

----------------

my named.ca lists a bunch of default servers. Nothing special.

Please give me some pointers of what I did wrong and how to fix them.

Thank you very much for you help and time.

Reply With Quote
  #2  
Old July 9th, 2004, 05:36 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,195 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 15 h 53 m 4 sec
Reputation Power: 77
So you read the sticky topics eh? Well, have ya looked for error information? Have you reloaded BIND?
__________________
Send me a private message if you would like me to setup your DNS for you for a price of your choosing. This is the preferred method if your DNS needs to be fixed/setup fast and you don't have the time to bounce messages back and forth on a forum. Also, check out these links:

Whois Direct | DNS Crawler | NS Trace | Compare Free DNS Hosts

Reply With Quote
  #3  
Old July 9th, 2004, 07:14 PM
notinhnotien135 notinhnotien135 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 notinhnotien135 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi SilentRage. Thank you for answering my request for help. Yeah, I did read thoroughly the "Bet you want to set up a DNS server" that you wrote. Very good one.

For the first sticky note, I just skimmed through it and believed that the info there applied to those with public IP addresses since you can actually using the tools to check whether the DNS server works or not. Others are very informational and excellent resources to get better understanding on DNS.

However, in my case, the domain mygoseals.com is a fake one that I want to use for my private Lan. I would like to set up Sendmail but since Sendmail requires to have DNS to work. I have to setup Bind that comes with Fedora 2. I want to setup so that I can use sendmail among the three computers and do not care about sending or receiving mail from outside my Lan.

I compared the files in your tutorial and mine. I don't know if I found all places that have the differences but I used:

@ IN SOA server-small.mygoseals.com. steven.mygoseals.com. (

and your files have:

@ SOA ns1 ( //in basiszone.com.zone file
postmaster

or

@ SOA ns1.basiczone.com. ( //12.7.0.0.rev
admin.basiczone.com.

Not only that I used

IN NS server-small.mygoseals.com.

in my files to mention about my DNS server and your files have:

@ NS ns1

I don't know much about DNS syntax so I can't tell how significant these can be.

In my named.conf, I also have a few zones that I don't know if I should remove them or not like the "localhost" and "0.0.127.in-addr.arpa" zones.
In your tutorial, you replace "0.0.127.in-addr.arpa" with the "67.345.12.in-addr.arpa" and you don't have "localhost". I am not sure about this, so could you suggest?

Since my setup is not for public access and just for LAN, I don't know what to leave out. I read and followed my setup based on book with Bind version 8.* something for RH 8 and edited the named.conf that came with the system. The book didn't mention at all about how many main zones to set up besides the one for domain and reverse lookup zones. And I don't see info mentioning about the number of zones either, just what the zones are ....

My other question is about my other files like resolv.conf, host.conf, hosts. Are they correct or did I really missed anything there?
And everytime I changed something in any of the files I would do

----------------------------------------
/etc/rc.d/init.d/named restart
Stopping named: rndc: connect failed: connection refused
[ OK ]
Starting named: [ OK ]
----------------------------

and then
---------------------------
tail /var/log/messages

Jul 9 17:24:04 server-small named: named shutdown succeeded
Jul 10 00:24:06 server-small named[2906]: starting BIND 9.2.3 -u named -t /var/named/chroot
Jul 10 00:24:06 server-small named[2906]: using 1 CPU
Jul 10 00:24:06 server-small named[2906]: loading configuration from '/etc/named.conf'
Jul 10 00:24:06 server-small named[2906]: listening on IPv4 interface lo, 127.0.0.1#53
Jul 10 00:24:06 server-small named[2906]: listening on IPv4 interface eth0, 192.168.254.12#53
Jul 10 00:24:06 server-small named[2906]: couldn't add command channel 127.0.0.1#953: not found
Jul 10 00:24:06 server-small named[2906]: couldn't add command channel ::1#953: not found
Jul 10 00:24:06 server-small named[2906]: running
Jul 9 17:24:06 server-small named: named startup succeeded
---------------------------
to see if named really start. ( I saw that named couldn't add command on port 953, but I don't know what this is for)

I also do
-----------------------------------
ps aux | grep named
named 2906 0.0 1.5 37392 2980 ? S 17:24 0:00 /usr/sbin/named -u named -t /var/named/chroot
root 2919 0.0 0.3 4064 588 pts/3 S 17:25 0:00 grep named
--------------------
just to make sure that named really runs.

I actually did these additional testings
-------------------
dig server-small.mygoseals.com

; <<>> DiG 9.2.3 <<>> server-small.mygoseals.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 52320
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;server-small.mygoseals.com. IN A

;; AUTHORITY SECTION:
com. 10800 IN SOA a.gtld-servers.net. nstld.verisign-grs.com. 1089348182 1800 900 604800 900

;; Query time: 121 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Jul 9 17:20:04 2004
;; MSG SIZE rcvd: 117
--------------------------
nslookup server-small.mygoseals.com

Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find server-small.mygoseals.com: NXDOMAIN
-------------------------------
nslookup yahoo.com
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
Name: yahoo.com
Address: 66.94.234.13
Name: yahoo.com
Address: 216.109.127.28
Name: yahoo.com
Address: 216.109.127.29

[root@server-small named]# nslookup www.tux.org
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
www.tux.org canonical name = gwyn.tux.org.
Name: gwyn.tux.org
Address: 199.184.165.135
-------------------------------------------------------

Thank you very much for you help.

Reply With Quote
  #4  
Old July 9th, 2004, 08:27 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,195 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 15 h 53 m 4 sec
Reputation Power: 77
Was the named.conf you edited in /etc/named.conf or /var/named/chroot/etc/named.conf? If it was in /etc/named.conf then you need to do the following commands:

killall -HUP named

By doing the above you force BIND to reload even though it appears rndc can't talk to it. Then tell me the results for the following command:

dig @127.0.0.1 server-small.mygoseals.com

Reply With Quote
  #5  
Old July 12th, 2004, 11:53 AM
notinhnotien135 notinhnotien135 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 notinhnotien135 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank SilentRage again. I am sorry to reply so late because I went away this weekend.

Here is what I have after booting up my system.

[root@server-small steven]# killall -HUP named
[root@server-small steven]# ps aux | grep named
named 998 0.0 1.6 37396 3116 ? S 09:33 0:00 /usr/sbin/named -u named -t /var/named/chroot
root 1730 0.0 0.3 4376 596 pts/1 S 09:49 0:00 grep named
[root@server-small steven]# dig @127.0.0.1 server-small.mygoseals.com

; <<>> DiG 9.2.3 <<>> @127.0.0.1 server-small.mygoseals.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4588
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;server-small.mygoseals.com. IN A

;; AUTHORITY SECTION:
com. 10568 IN SOA a.gtld-servers.net. nstld.verisign-grs.com. 1089578826 1800 900 604800 900

;; Query time: 51 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jul 12 09:50:04 2004
;; MSG SIZE rcvd: 117
--------------------------------------------

Thank SilentRage once again for helping me out.

Reply With Quote
  #6  
Old July 12th, 2004, 12:03 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,195 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 15 h 53 m 4 sec
Reputation Power: 77
I finally noticed the ps command.

-t /var/named/chroot

That switch is making BIND chroot. Among other things, this means BIND is loading the config from "/var/named/chroot/etc/named.conf" Was this your intention?

Reply With Quote
  #7  
Old July 13th, 2004, 11:24 AM
notinhnotien135 notinhnotien135 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 notinhnotien135 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi, SilentRage. Oh no. I don't even know what that do. I've always edited the file in /etc/named.conf. After killing named, I just wanted to make sure that named really run so that was why I did the ps.

So, how could I change this to make it run my /etc/named.conf? Should I run named as root or just regular user?

Thank again, SilentRage.

Reply With Quote
  #8  
Old July 13th, 2004, 11:38 AM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,195 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 15 h 53 m 4 sec
Reputation Power: 77
Either you can execute it directly, or you need to modify your startup/service scripts to remove the -t switch.

Reply With Quote
  #9  
Old July 13th, 2004, 12:59 PM
notinhnotien135 notinhnotien135 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 notinhnotien135 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi, SilentRage. Thank you so much for pointing out that my system was chrooting. I messed around with my files and found out that I had to soft link /var/named/chroot/etc named.conf and rndc.key file to /etc/ named.conf and rndc.key file. So I moved my /etc/ 2 files to the new dir and soft link them back to /etc/.
After that I restart named but I found out that it loaded some files somewhere else and didn't find my db.* files. Apparently named must load from /var/named/chroot/var/named/ db.* file, so I move my /var/named/ db.* files to that directory. After that everything worked like a charm.

Before that I did went to modify my startup script in /etc/rc.d/init.d/named but whenever I tried to execute named, it would just died on me, even if I did with "named -u named", so i have to firgure out the other workaround. I believe chroot prevents named from doing something like that. I don't know much about chroot thing so I'd better go and take a look at that to see what really happened.

From the bottom of my heart, I would like to say thank to you, Silent Rage. You are the most friendly and helpful guru out there. Thanks once again.

BTW. I made some spelling mistakes in my db.* files. sever-small should be sever-small. I also removed the localhost zone, so only 4 zones left.

Reply With Quote
  #10  
Old July 13th, 2004, 01:12 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,195 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 15 h 53 m 4 sec
Reputation Power: 77
heh, well you could've gotten it working without the chroot. It's just a matter of finding what the problem was, but the important thing is that you got it working. chrooting is an additional and optional security precaution, so there's no harm in using it if it works.

As for a quick definition of what chroot is:

A process can chroot to any directory on your file system. After it chroot's, and if it isn't running as root, that process will only have access to files in the chroot directory. All file accesses is relative to the chroot directory. So yeah, all of your BIND related text files need to be in the chroot directory with the appropriate path.

Reply With Quote
  #11  
Old July 24th, 2004, 12:35 PM
vgeorge vgeorge is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 vgeorge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up Make named work fine

in "-> etc/rc.d/init.d/named <-"
remove the "-> ${OPTIONS} <-" in line after start() <-"
"-> daemon /usr/sbin/named -u named ${OPTIONS} <-"
so it will be
"-> daemon /usr/sbin/named -u named <-"

This will make named run without -t paramater as like Red Hat 9


George Vourliotis
Hellas (Greece)

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationDNS > DNS server fails to look up itself but able to serve others to surf the web


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: »