LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-30-2007, 12:02 PM   #1
ashesh0326
Member
 
Registered: Jan 2007
Distribution: Suse 10.0, FC 6
Posts: 93

Rep: Reputation: 15
Question Using named as my personal DNS


Well, to start with, my idea may seem a little too whacky to many of you.
Anyways, let me get down to the problem. Here it comes:
Well, I've been using linux for around 2 months and I'm loving experimenting with it. And since I use a slow dialup connection, I thought why not figure out my own DNS, on my computer itself?
(I use a GPRS connection using my Nokia 3220, and having my own DNS can speed up my surfing by as much as upto 1-2seconds per page)
So, I found out about named and started working on configuring it. I went through the RedHat site to know more about configuring named and added the DNS ip's I got from my ISP under forwarders and everything looked fine. Next, I modified my resolv.conf file so that my browsers use only 127.0.0.1 as a nameserver from now on.
The problem arose when I tried using the 'dig' command.
For example, when I typed "dig google.com" I got an "ID Mismatch... Expected xxxx, Received yy SRVFAIL" message (after 2-3 seconds of delay, which means that my query must've been forwarded).
And that probably means that the DNS under the forwarders list did get a message from my DNS about the query, and they also replied. But then, something made my DNS incorrectly process the reply.
So, I guess, that is it. I've tried searching for the solution all over the web, and nothing has been of much help.
Also, can anyone of you please let me know about updating my DNS database? And any ideas about how to download the data from rs.internic.net? I've tried ftp-ing to that site, but it never connects. Any ideas?
What do you say?
 
Old 01-30-2007, 01:44 PM   #2
ashesh0326
Member
 
Registered: Jan 2007
Distribution: Suse 10.0, FC 6
Posts: 93

Original Poster
Rep: Reputation: 15
By the way, the exact error message I get is:
[root@localhost etc]# dig redhat.com
;; Warning: ID mismatch: expected ID 10251, got 10036
;; Warning: ID mismatch: expected ID 10251, got 10036
;; Warning: ID mismatch: expected ID 10251, got 10036

; <<>> DiG 9.3.4 <<>> redhat.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 10251
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

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

;; Query time: 431 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Jan 31 00:55:39 2007
;; MSG SIZE rcvd: 28
 
Old 01-30-2007, 02:38 PM   #3
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 536

Rep: Reputation: 36
Why bother with forwarding the requests to your ISP. Just set up a caching nameserver of your own.

Cheers.
 
Old 01-30-2007, 04:36 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Yes, you're under no obligation to forward requests to your ISPs nameservers. Also, you have some misconfiguration to get that error. Try doing
Code:
dig redhat.com @localhost
and post the results.

You also could simply set /etc/resolv.conf to 127.0.0.1, and get rid of that forwarders clause in named.conf. Unless your ISP blocks traffic at port 53, but that would be very strange. 25 and 80 maybe, but I've never heard of someone forcing you to use their DNS.

Peace,
JimBass
 
Old 01-31-2007, 12:05 AM   #5
ashesh0326
Member
 
Registered: Jan 2007
Distribution: Suse 10.0, FC 6
Posts: 93

Original Poster
Rep: Reputation: 15
Well, I see what you mean, but then, what if my DNS fails to resolve a hostname? It will need a backup in that case right??
The RedHat site says that the request shall be forwarded to the nameservers in the forwarders clause only if my DNS fails to resolve the request. Here's the link: http://www.redhat.com/magazine/025no...cm_edmsept_007

Also, can you guys please link me to a website from which I can download the hostname - ip database for named? Or, do I have to build it on my own? (rs.internic.net is not working, I suppose...)
Another thing is that the nameserver works fine if I stop and start named after rebooting.
Thanks a lot for your time guys. I really appreciate your help.
 
Old 01-31-2007, 12:31 AM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
No, you're not understanding. If your server fails to resolve a name, so will your forwarders. If you are a DNS server under normal configuration (the way it comes out of the box), you will be every bit as accurate as your ISP. There will be absolutely no difference.

Also, there is no such thing as the IP-name database. If such a thing existed, it would be HUGE, like gigabytes of data, and by the time you download it, parts of it would already be wrong. Anytime you server makes a request for a name, it looks at itself first, to see if the info is there. If it doesn't exist, then it goes to the roots to say, "what is the address for domain.com". Then the roots tell your machine, "ns1.domain.com and ns2.domain.com are authoritative for domain.com." Your server would then send a request to ns1.domain.com, asking for the address of domain.com, it gets it, and it is over. The whole thing takes only 40-60 milliseconds, even on phone lines, as it is so little data.

Peace,
Jim
 
Old 01-31-2007, 02:30 AM   #7
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 536

Rep: Reputation: 36
I took a look at that article, and how it's set up. What it does, it forward requests to your ISP's nameserver for requests that are not already cached, which is different from requests that can't be resolved.

You would be better to set up a "true" caching nameserver, that doesn't rely on your ISP, IMHO.

Cheers.
 
Old 01-31-2007, 08:51 AM   #8
ashesh0326
Member
 
Registered: Jan 2007
Distribution: Suse 10.0, FC 6
Posts: 93

Original Poster
Rep: Reputation: 15
Thanks Jim, that really clarified to me how a DNS is supposed to work.
I've done what you told me, and it seems to be working fine now.
But then, I still get this quite frequently:

[root@localhost ~]# nslookup ip-adress.com
;; connection timed out; no servers could be reached


And if I try the same request 2-3 times again, then it works fine.
Also, is there some way to retian the cached data so that it remains conserved even after a reboot?
Because I've tried nslookup something.com before and after reboot, and it seems that root-servers.net is contacted each time after a reboot.

Thank you so much for the help.
 
Old 01-31-2007, 10:27 AM   #9
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
You're welcome for the help. You can't use nslookup as a serious DNS debugging tool, because it gives no useful info, just an address or lack of an address. The tool to use is called dig, and it is part of the BIND package so you'll have it. Try
Code:
dig domain.com @localhost
If you wrote what you literally meant, you are trying to find the domain name that matches the IP address, then you would want
Code:
dig -x 22.33.44.55 @localhost
The command man dig will give you tons of info about how to use the dig command in other circumstances.

You can't keep the cache through a reboot. The cache lives in RAM memory, so any reboot will wipe it clean. Why are you rebooting? You're not in windows anymore. The only time linux needs a reboot is if you update to a new kernel. Every other issue can be taken care of within linux. Your DNS box is a server. Treat it as such, and leave it on 24/7/365.

You're welcome for the help.

Peace,
JimBass
 
Old 01-31-2007, 11:04 PM   #10
ashesh0326
Member
 
Registered: Jan 2007
Distribution: Suse 10.0, FC 6
Posts: 93

Original Poster
Rep: Reputation: 15
Thank you so much Jim. Now I'm really getting the feel of things...
As far as rebooting is concerned, I'm going to leave my PC on from now on.
By the way, I have another question. I am using an outdated version of FCore, and I've been thinking of switching over to SUSE 9.x or above. And since, I'm pretty much smitten with the server functionality linux offers to a computer, I just wanted to knoq if SUSE provides the same kind of server support (given that I install using the 'server' option checked during the install.)
For instance, does SUSE also have a GUI based 'Server Services' for editing runlevels? (FC does.)
 
Old 01-31-2007, 11:20 PM   #11
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
All linux is basically the same thing. You don't get anything in a server version that you can't also get for a desktop version. To my mind, both Fedora and Suse are desktop distros. I would consider the more "pure" server distros to be Slackware, Debian (stable), and Gentoo. That being said, I know plenty of people running those distros on their desktop as well.

If you're serious about a server, then you don't want a GUI at all. The reason for that is drawing pictures, though not memory intensive, does take both processor and RAM power. Running everything from the command line doesn't waste those resources. I may be old school on this, but no server I run will have X windows installed.

You ever try to start a new program in X, and everything locks up for a second or 2 as the system starts the new program? If your machine doesn't do that, open a terminal, type in "top" without the quotes, and then see what happens when you open a new browser. The use goes up, usually by a hefty amount. Once it is open it will drop back down, but I don't want my server lagging as it draws pictures for only me to look at.

Any distro can be installed without X windows. I really really dislike any of the distros that use rpm packages, but many of the folks here really like them. That being said, no matter what distro you use, the power of linux is in the command line. You can do tons of things with just text that are far beyond what you can do with pictures, or much faster. You need to know your distro's commands inside and out though. Checkout the website http://linuxcommand.org , which gives a great overview of the bash shell, not specific to any distro. Then check out your distro's forum, and see how people run things. You'll see the FC forum is more about, "run this program, start this GUI", whereas Debian and Slack are more, "type this, type that". Also, learn the man and info commands. Typing "man programname" or "info programname"(again without quotes) will give you all the info that about how to use that command in the terminal.

Peace,
JimBass
 
Old 01-31-2007, 11:27 PM   #12
porzech
Member
 
Registered: Jan 2007
Distribution: Suse, Ubuntu
Posts: 31

Rep: Reputation: 15
in suse there is a tool called yast, and its either a text based gui or x windows app for configuring most of functionall aspects of your linux (not all of them tho, some services need manual editing of their config files)
 
Old 02-01-2007, 02:05 AM   #13
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 536

Rep: Reputation: 36
Look at my profile, and guess what I run as my server, and would suggest.

But you really have to get your hands dirty with the command line. Although, I do run a very minimal X on it.

Cheer.
 
  


Reply

Tags
bind, dns, named, networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
bind, named, and DNS cwwilson721 Slackware 1 12-07-2006 06:24 AM
DNS(named) question LordNimrod Linux - Networking 11 02-23-2006 04:35 AM
DNS named and /etc/hosts Pollyanna Linux - Networking 0 03-22-2004 02:39 PM
named - dns - problems blaci Linux - General 2 07-22-2003 01:32 AM
[DNS/NAMED] What is the SOA? BxBoy Linux - Networking 1 03-09-2003 04:31 PM


All times are GMT -5. The time now is 02:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration