Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forward all hostnames except one
07-15-2014, 07:12 AM
Post: #1
Question Forward all hostnames except one
I found this blog post that Sam wrote in November 2011 (http://samiam.org/blog/20111128.html) that describes what I’m trying to achieve with MaraDNS. That is, resolve all hostnames normally using my ISP’s DNS servers, but control the resolution of one particular host name. As in the blog post, I don’t have the option of running 2 servers (Mara and Deadwood) as I only have 1 IP address.

My question is simple: Is the solution provided in this post from 2011 still the best solution for this situation? If so, just wondering if a download of MaraDNS 1.4.07 will still be available after it’s End of Life in 2015? (Also, the link to v1.4.07 in the blog post is broken).

Thanks
Find all posts by this user
Quote this message in a reply
07-18-2014, 11:07 AM
Post: #2
RE: Forward all hostnames except one
I would say the best way to have custom resolutions for some host names would usually be via the hosts file, which is /etc/hosts in Linux/UNIX and Mac OS X, and (usually) Windows/System32/drivers/etc/hosts on Windows systems.

To have "foo.example.com" resolve to "10.1.2.3", add this line to the hosts file:

Quote:10.1.2.3 foo.example.com
Visit this user's website Find all posts by this user
Quote this message in a reply
07-18-2014, 11:25 AM
Post: #3
RE: Forward all hostnames except one
Thanks Sam.

My issue is that I don't have access to the hosts file on mobile devices. See, my setup is as follows:
I have a Windows PC where I do development on several websites (i do dev work on the pc, and then push to LIVE). so I setup a hostname for each site: sitename.mydevserver.com
For testing, I need to be able to access sitename.mydevserver.com from several mobile devices. But I can't edit the hosts file on the mobile devices (without rooting/jailbreaking them, which I don't want to do).

So, the solution I'm shooting for is to setup a DNS server on my PC, and then instruct my mobile devices to use my PC's IP address for their DNS. If I can get the DNS server on my PC to forward all hostnames except *.mydevserver.com to my ISP's DNS servers, I'll be in buisness.
Find all posts by this user
Quote this message in a reply
07-18-2014, 04:20 PM (This post was last modified: 07-18-2014 05:06 PM by samiam.)
Post: #4
RE: Forward all hostnames except one
Let’s use a configuration from an old mailing list posting as a base:

http://maradns.samiam.org/old-list-archi...00992.html

Some errors there; here’s a better dwood3rc snippet:

Quote:upstream_servers = {}
upstream_servers["foo.example.com."]="127.0.0.1"
upstream_servers["."] = "8.8.8.8, 8.8.4.4" # Google public DNS

bind_address="192.168.0.199"
recursive_acl = "192.168.0.0/24"
filter_rfc1918 = 0

And a good mararc snippet:

Quote:ipv4_bind_addresses = "127.0.0.1"
csv2 = {}
csv2["example.com."] = "db.example"

As well as the /etc/maradns/db.example file

Quote:foo.example.com 10.1.2.3

Some points:
  • Deadwood listens on 192.168.0.199. That IP will probably be replaced
  • MaraDNS listens on 127.0.0.1
  • Deadwood uses 8.8.8.8 and 8.8.4.4 to resolve most names on the Internet
  • Deadwood uses 127.0.0.1 to resolve foo.example.com. We will probably replace “foo.example.com” with another name.
  • MaraDNS resolves foo.example.com on 127.0.0.1 for Deadwood with the IP 10.1.2.3; the IP will probably be replaced.

Somewhat related:

http://maradns.samiam.org/faq.html#oneip

- Sam
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)