# DSL + static IP...can't get BIND to work

## zambizzi

I've been at this on-and-off for a month now and can't seem to get it right.  I've got business-class DSL so I can have static IPs.  Right now I have one static IP and I'm trying to setup a domain...and have had no success so far.  I've done this before when I managed a Gentoo server I rented from SevenL and it was a snap so I'm thinking there might be a problem w/ my ISP - even though they swear up-and-down that I'm the one doing something wrong.

So, I've got a DSL modem which I forward all traffic from it directly to my Linksys router...it uses PPPoE authentication for this.  My connection works great and so far as I know...it's all setup correctly.  I've got a single server sitting here running a 'headless' Gentoo installation and I'm using BIND as my DNS server.

My router has DHCP enabled but I've assigned all PCs a static IP internally...all run Gentoo.  The server uses 192.168.1.150.  On my router I set 192.168.1.150 in the DMZ so I wouldn't have an issue w/ ports.

Here's my named.conf:

```

options {

        directory "/var/bind";

        listen-on-v6 { none; };

        listen-on { 127.0.0.1; 192.168.1.150; 65.103.216.158; };

        pid-file "/var/run/named/named.pid";

};

zone "." IN {

        type hint;

        file "named.ca";

};

zone "localhost" IN {

        type master;

        file "pri/localhost.zone";

        allow-update { none; };

        notify no;

};

zone "127.in-addr.arpa" IN {

        type master;

        file "pri/127.zone";

        allow-update { none; };

        notify no;

};

zone "zambizzi.org"{

        type master;

        file "pri/zambizziorg.zone";

        allow-update { none; };

        notify no;

};

```

Here's the domain's bind conf file (zambizziorg.zone):

```

$TTL 86400         

@       IN      SOA     zambizzi.org.   hostmaster.zambizzi.org. (

   2000021600 ; serial      

   86400 ; refresh          

   7200 ; retry             

   1209600 ; expire         

   86400 ) ; default_ttl   

       IN NS           ns1.zambizzi.org.

       IN NS           ns2.zambizzi.org.

       IN MX    5      mail               

ns1    IN A            192.168.1.150    

ns2    IN A            192.168.1.150    

mail   IN A            192.168.1.150    

       IN MX    5      192.168.1.150    

www    IN A            192.168.1.150    

```

I tried using the static IP address in the place of 192.168.1.150 in the conf above and it made no difference.

At godaddy.com, registrar for my domain, I created ns1.zambizzi.org and ns2.zambizzi.org using the same static IP address assigned to me by my ISP.  I did this weeks ago so they're definitely good.  I can ping both of these so I know they're working...but I cannot ping mydomain.com...it can't be found.

If you try to pull up http://65.103.216.158, you'll see that apache is installed and working and the IP is setup fine.

What am I doing wrong?  I know some of you out there have probably been through this...any ideas?

Thanks!

----------

## Ateo

```

$TTL 86400         

@       IN      SOA     zambizzi.org.   hostmaster.zambizzi.org. (

   2000021600 ; serial      

   86400 ; refresh          

   7200 ; retry             

   1209600 ; expire         

   86400 ) ; default_ttl   

       IN NS           ns1.zambizzi.org.

       IN NS           ns2.zambizzi.org.

       IN MX    5      mail               

ns1    IN A            192.168.1.150    

ns2    IN A            192.168.1.150    

mail   IN A            192.168.1.150    

       IN MX    5      192.168.1.150    

www    IN A            192.168.1.150    

```

Your zone records are totally wrong but you have the right idea. If you're trying to set up web services to be accessible from the net, you cannot set your A and/or MX records to private IP addresses. They need to be the static, public IP your ISP gave you. Then you need to set up forwarding on your router for both web services and DNS... In other words, change 192.168.1.150 to 65.103.216.158 and restart bind. Don't expect instant propagation though.

----------

## zambizzi

Well, I just changed that today.  Before today all of those zone records were set to the public IP address the ISP assigned to me.  Like I said in my first post, that didn't work either.  I was still unable to ping zambizzi.org.

Also, port forwarding has been on since day one.  However, I switched the router and put 192.168.1.150 (the server) in the DMZ so all ports are open.  Even still, I've got port 53 and 80 forwarded from the public IP to the private IP for the same ports.

I'd say they were setup "correctly" for close to three weeks...just changed it today.

----------

## zambizzi

OK, changed it at 12:00, it's now 4:00....and I still can't resolve zambizzi.org.  I rebooted BIND after making the change, also.

Here's what I changed it to this morning:

```

$TTL 86400         

@       IN      SOA     zambizzi.org.   hostmaster.zambizzi.org. (

   2000021600 ; serial      

   86400 ; refresh          

   7200 ; retry             

   1209600 ; expire        

   86400 ) ; default_ttl   

       IN NS           ns1.zambizzi.org.

       IN NS           ns2.zambizzi.org.

       IN MX    5      mail               

ns1    IN A            65.103.216.158    

ns2    IN A            65.103.216.158    

mail   IN A            65.103.216.158    

       IN MX    5      65.103.216.158    

www    IN A            65.103.216.158    

```

----------

## Ateo

What name servers do you have in resolv.conf on the computer you're trying to ping from? your ISPs or this bind server?

----------

## Ateo

Your mail record is a bit off. It should appear as such:

```
zambizzi.org.         IN      MX      5 mail.zambizzi.org.

mail.zambizzi.org.  IN      A       65.103.216.158
```

----------

## zambizzi

 *Ateo wrote:*   

> What name servers do you have in resolv.conf on the computer you're trying to ping from? your ISPs or this bind server?

 

I have no idea, I assume they're the IPs that were picked up during the Gentoo install...which happened while I was using a different ISP...could this be the problem?

The PC I'm writing from and the server were both done while using my old ISP.  However, while at work on Windows I'm unable to ping it.  I've also asked a couple of ICQ buddies to ping zambizzi.org and no one can hit it.

----------

## digitalenemy

you can only have 1 A-record per IP, the others have to be CNAME's and the MX Record must point to either a CNAME or A record iirc. But it has to be the dns name, not the ip.

it's too long ago since i set up mine, here is a very good how-to for bind i used then http://langfeldt.net/DNS-HOWTO/BIND-9/

----------

