[CLUE-Tech] dns example
Mike
lister-clue at gantsfort.com
Fri Jul 4 00:04:40 MDT 2003
On Wed, Jul 02, 2003 at 08:35:09PM -0600, Mike Staver wrote:
> Hello - I think I have a complicated question here, so here goes. I have
> a local DSL based network I'm trying to set up. The local ip range is
> 192.168.0.1 - 192.168.0.255. I'm running the following services on one
> box:
>
> DNS Server
> Web Server
> Mail Server
>
> I'm trying my best to figure out how to create a proper zone file that
> makes all this work - my problem is the external ip, let's say 1.1.1.1 is
> my external ip - I'm trying to figure out to get all the local machines
> and all external machines to understand that I'm running a mail server,
> and that all email going to whatever at newdomain.org should go to that
> server. I currently have port forwarding working flawlessly on my dsl
> router, pointing all the right ports to 192.168.0.25 (my server). I'm
> going to register a domain name and have it pointed at my network, so I'm
> assuming I tell Net Solutions to look to my new dns server at 1.1.1.1.
> Somehow, I need my zone to work with the local ip range and external ip
> happily.... here is what I have so far, and I don't think it's correct:
>
> ----------------------------------------------------------
> ORIGIN .
> $TTL 3600 ; 1 hour
> newdomain.org IN SOA elway.oaks.newdomain.org.
> administrator.oaks.newdomain.org. (
> 12 ; serial
> 900 ; refresh (15 minutes)
> 600 ; retry (10 minutes)
> 86400 ; expire (1 day)
> 3600 ; minimum (1 hour)
> )
> NS dns.newdomain.org.
> NS elway.oaks.newdomain.org.
> $ORIGIN newdomain.org.
> dns A 1.1.1.1
> dsl A 1.1.1.1
> mail MX 5 1.1.1.1.
> elway.oaks A 192.168.0.25
> www A 1.1.1.1
> ----------------------------------------------------------
>
> Does anyone have an example of this kind of setup... has anyone been able
> to successfully pull this off before?
>
I've done this same setup at home. My ISP never asked for my domain
name. They only supplied the IP address. I registered my domain with
register.com and set the IP address in there DNS record to the IP
address assigned to me by my ISP. Additionally, I set aliases for mail
and www via register.com configuration.
This external IP is _not_ in any of my DNS configuration files. Also, be
sure you forward port 53 (nameserver).
Here are my config files:
------------
---- named.conf
------------
options {
directory "/var/bind";
// uncomment the following lines to turn on DNS forwarding,
// and change the forward ip address(es) :
forward first;
forwarders {
xxx.xxx.xxx.xxx;
x.x.x.x;
};
pid-file "/var/run/named/named.pid";
};
zone "." in {
type hint;
file "named.ca";
};
zone "mydomain.com" in {
type master;
file "pri/db.mydomain";
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "pri/127.0.0";
};
zone "0.168.192.in-addr.arpa" in {
type master;
file "pri/192.168.0";
};
------------
---- db.mydomain
------------
$TTL 3D
@ IN SOA dns.mydomain.com. hostmaster.mydomain.com. (
1 ; serial
8H ; refresh
2H ; retry
4W ; expiry
1D ) ; minimum
;
; name server
;
IN NS dns.mydomain.com.
;
; mail exchanger
;
MX 10 dns.mydomain.com.
localhost A 127.0.0.1
MX 10 dns
host1 A 192.168.0.4
MX 10 dns
dns A 192.168.0.5
MX 10 dns
host2 A 192.168.0.2
MX 10 dns
mail CNAME dns
www A 192.168.0.5
------------
---- 192.168.0
------------
$TTL 3D
@ IN SOA dns.mydomain.com. hostmaster.mydomain.com. (
42 ; serial
2D ; refresh
4H ; retry
6W ; expiry
1W) ; minimum
IN NS dns.mydomain.com.
4 IN PTR host1.mydomain.com.
5 IN PTR dns.mydomain.com.
------------
---- 127.0.0
------------
$TTL 3D
@ IN SOA dns.mydomain.com. hostmaster.mydomain.com. (
1 ; serial
8H ; refresh
2H ; retry
4W ; expiry
1D ) ; minimum
IN NS dns.mydomain.com.
1 IN PTR localhost.
Use these files as a template for your domain. Set the "forwarders" to
the DNS servers of your ISP. Note that I have my DNS, mail, and web
server all on the same box. Which is what you wanted to do. Oh, and I
almost forgot (very important) you will also have to set your DSL
routers IP address to the address given to you by your ISP. And there is
more...lots of details...the DSL router address is 192.168.0.1. This
will also be your default route for your ethernet card.
If you have any more questions, I'm out of town for the next two days
and will answer on Sunday. Good Luck!
Mike
More information about the clue-tech
mailing list