LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 08-20-2008, 04:20 PM   #1
netjack
Member
 
Registered: Sep 2003
Location: Italy
Distribution: ubuntu 12.04 64 bit
Posts: 93

Rep: Reputation: 15
How to create own DNS service?


Hi,

how can I configure my Linux (ubuntu 8.04) that way, that it is also a DNS service, i.e. not using any DNS servers neither from my provider, nor free services like OpenDNS?

I'd like not to depend from other DNS servers any more, and have a DNS service (simple nameserver caching) running in background, which depends only from root servers.

Thanks
 
Old 08-20-2008, 04:39 PM   #2
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
Good luck getting DNS responses from 'root' servers. From what I know, not just any Joe can use them as the primary DNS server for a system. Also, even though you would have a caching local DNS server, every time you would try to get a new site, there would be a performance hit. See, most DNS requests never make it to the root servers because ISP's have their own name servers set up that practically mirror the root servers, and these ISP name servers are normally able to answer your request much quicker simply because they are geographically closer to you (yes, the further away you are from another server, the larger the latency). So in short, it's best to stick with your ISP's nameservers because you can't get to the root servers and it would be a performance hit (unless for some reason you live near one ). If everyone connected to root DNS servers for lookups, the internet would come to a screeching halt.

As for setting up a local DNS server on your machine, you would need bind.

http://ubuntuforums.org/showthread.php?t=236093
http://www.ubuntugeek.com/dns-server...in-ubuntu.html

Search more on google if these aren't for you.

Good luck.
 
Old 08-21-2008, 12:30 AM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
You can install a caching-only nameserver with BIND, djbdns (tinydns), maradns, powerdns, etc... How you configure it depends on which package you choose
 
Old 08-13-2015, 10:56 PM   #4
RipClaw
LQ Newbie
 
Registered: Oct 2005
Distribution: PCQ Linux 2006
Posts: 19

Rep: Reputation: 0
Wink

Quote:
Originally Posted by netjack View Post
Hi,

how can I configure my Linux (ubuntu 8.04) that way, that it is also a DNS service, i.e. not using any DNS servers neither from my provider, nor free services like OpenDNS?

I'd like not to depend from other DNS servers any more, and have a DNS service (simple nameserver caching) running in background, which depends only from root servers.

Thanks
All you have to do is possibly run this, and it kind of works out of the box.
http://maradns.samiam.org/deadwood/

Last edited by RipClaw; 08-14-2015 at 12:29 AM.
 
Old 08-14-2015, 12:26 AM   #5
RipClaw
LQ Newbie
 
Registered: Oct 2005
Distribution: PCQ Linux 2006
Posts: 19

Rep: Reputation: 0
Smile

Here is the strace output for Deadwood DNS doing recursive resolution
I tried to do a nslookup for www.trade.com
Deadwood connected to 192.43.172.30, the one that helps in resolving .com domain names(https://www.iana.org/domains/root/db/com.html)
and found the authoritative DNS server for the "trade" domain, under com, which is 216.69.185.43 (not in output)
Then in reaches out to 216.69.185.43 to figure out the IP address of www.trade.com
Check here : http://www.dnsstuff.com/tools#dnsRep...=www.trade.com

Code:
fcntl(3, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
recvfrom(3, "\372s\1\0\0\1\0\0\0\0\0\0\3www\5trade\3com\0\0\1\0\1", 520, 0, {sa_family=AF_INET, sin_port=htons(52074), sin_addr=inet_addr("127.0.0.1")}, [16]) = 31
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
bind(4, {sa_family=AF_INET, sin_port=htons(16934), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.43.172.30")}, 16) = 0
sendto(4, "\212Q\0\0\0\1\0\0\0\0\0\0\3www\5trade\3com\0\0\1\0\1", 31, 0, NULL, 0) = 31
select(5, [3 4], NULL, NULL, {0, 50000}) = 0 (Timeout)
select(5, [3 4], NULL, NULL, {0, 50000}) = 1 (in [4], left {0, 27084})
recvfrom(4, "\212Q\200\0\0\1\0\0\0\2\0\2\3www\5trade\3com\0\0\1\0\1\300"..., 514, 0, NULL, NULL) = 115
close(4)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
bind(4, {sa_family=AF_INET, sin_port=htons(18660), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("216.69.185.43")}, 16) = 0
sendto(4, "u\312\0\0\0\1\0\0\0\0\0\0\3www\5trade\3com\0\0\1\0\1", 31, 0, NULL, 0) = 31
select(5, [3 4], NULL, NULL, {0, 50000}) = 1 (in [4], left {0, 37735})
recvfrom(4, "u\312\204\0\0\1\0\1\0\2\0\0\3www\5trade\3com\0\0\1\0\1\300"..., 514, 0, NULL, NULL) = 99
sendto(3, "\372s\201\200\0\1\0\1\0\0\0\0\3www\5trade\3com\0\0\1\0\1\300"..., 47, 0, {sa_family=AF_INET, sin_port=htons(52074), sin_addr=inet_addr("127.0.0.1")}, 16) = 47
close(4)                                = 0
Code:
> www.trade.com  
Server:		127.0.0.1
Address:	127.0.0.1#153

Non-authoritative answer:
Name:	www.trade.com
Address: 92.52.90.198
>

Last edited by RipClaw; 08-14-2015 at 01:07 AM.
 
Old 08-14-2015, 04:00 PM   #6
jefro
LQ Guru
 
Registered: Mar 2008
Posts: 13,338

Rep: Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691Reputation: 1691
Make hosts file entries for the 50 or so pages you visit often. Then for others use google, it acts like a dns on links.

Although not what you asked of course.

Last edited by jefro; 08-17-2015 at 04:19 PM.
 
Old 08-14-2015, 08:23 PM   #7
Doug G
Member
 
Registered: Jul 2013
Posts: 243

Rep: Reputation: Disabled
dnsmasq is a pretty easy lightweight solution for lan dns. It has some advantages over hosts files, such as being able to provide MX records for internal domains.
 
  


Reply

Tags
dns, linux, service


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
Can someone help me create a service menu Christof999 Linux - Desktop 5 08-17-2007 12:40 PM
How to custom create a service Scrag Linux - General 2 02-07-2006 07:50 PM
How to create a service that monitors a file Pastorino Linux - Software 2 09-23-2005 07:29 PM
how to create service phoenix_fei Programming 2 07-13-2005 04:56 PM
DNS Service ddepuemd Linux - Networking 1 05-16-2002 11:17 AM


All times are GMT -5. The time now is 04:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration