Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Google Public DNS servers on my mail server. However, URIBL and other spam blocking sites (which work over DNS) block major DNS sites such as Google Public DNS.

I think if I run my own DNS server on my mail server, then URIBL and others will work because my server IP won't be blacklisted.

How do I accomplish this with an open source DNS server?


I really want to avoid running BIND if possible. I want to use something lightweight such as dnsmasq or pdnsd, thinking that this is more secure.

share|improve this question

You should use the BIND DNS server. It's fairly straight forward. On Debian systems, use:

$ sudo apt-get install bind9

Then configure your resolv.conf to point to localhost.

share|improve this answer
Are you saying it's not possible to use something lighter-weight, such as dnsmasq or pdnsd? I have edited my question, would you please clarify your answer? – g33kz0r Oct 12 '13 at 14:05
From the man page of dnsmasq: "Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server.". Which means it cannot resolve queries by itself. You will have to point your configuration to a recursive DNS server (like BIND) which can iteratively fetch the corresponding DNS records. As a more secure alternative, I agree with BIND's shortcomings. djbdns is an option but I have not used it personally. – sandyp Oct 15 '13 at 18:36

To avoid the URIBL block, you must either point to a recursive DNS server that isn't itself blocked, or you must run your own fully recursive DNS server on your own IP address (that presumably isn't blocked). As suggested, you can run something full-featured such as bind or djbdns. You can't get away with a "lightweight" DNS server such as dnsmasq that forwards its queries to another DNS server, since if that worked you could simply use that other DNS server directly!

Another thing that might work, instead of running your own DNS, is to use the DNS server of the ISP or hosting company that hosts your mail server. It may not be blocked.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.