HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Installation/Configuration (
-   -   Setting up a multi site web server and DNS (

wxman 27th October 2007 04:59

Setting up a multi site web server and DNS
I've been reading tons about setting up my own nameserver both on the web, and books. I think I grasp most of it, but one thing - setting up the main records in the named.conf and zone files. I'm sure it's much easier than I'm making it. I'm using ISPConfig to set up my other web sites that will go on the server, and I manually set up the entry for my ns1 in the named.conf and zone file. I don't have a secondary NS server yet, but I will as soon as I get around to setting up another computer next to this one. For now I'm fudging the ns2 by using a Godaddy parked nameserver.

This is my current NAMED.CONF:

options {
        pid-file "/var/run/bind/run/";
        directory "/etc/bind";
        auth-nxdomain no;
        * If there is a firewall between you and nameservers you want
        * to talk to, you might need to uncomment the query-source
        * directive below.  Previous versions of BIND always asked
        * questions using port 53, but BIND 8.1 uses an unprivileged
        * port by default.
        // query-source address * port 53;

// a caching only nameserver config
zone "." {
        type hint;
        file "db.root";

zone "" {
        type master;
        file "db.local";

zone "" {
        type master;
        file "";

zone "" {
        type master;
        file "";

And this is the zone I made for my

; BIND reverse data file for empty rfc1918 zone
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
$TTL    86400
@      IN      SOA (
                        102420071      ; Serial
                        604800        ; Refresh
                          86400        ; Retry
                        2419200        ; Expire
                          86400 )      ; Negative Cache TTL
        IN      NS
        IN      MX      10
@      IN      NS      localhost.
ns1    IN      A
ftp    IN      CNAME

What I'm aiming for is to run a primary dns server here, along with the rest of the web server setup, then set up a second server for the secondary dns. I want to use the I've already set up, and I will set up, as the name servers for all of the web sites I'm going to host. I think I understand to set up the not as a web site, but just the nameserver. I also need email, and ftp for all the sites as well using their own domains.

I just need to know if it looks like I'm on the right track now. Any advice would be welcome.

falko 28th October 2007 15:57

Looks ok, but as is hosting the zone for, you also need a glue record:

wxman 28th October 2007 20:26


Originally Posted by falko
Looks ok, but as is hosting the zone for, you also need a glue record:

Thanks for the reply Falko.

I'm not going to be using as a working web site for now. I just set it up to use as a name server. I thought I set the glue record at Godaddy by registering there with it's IP address.

Right now I'm trying to get my test email address, , to work. It sends out ok using SquirrelMail, but when I send to it I get:

Your message cannot be delivered to the following recipients:
Recipient address:
Reason: SMTP client-server loop detected
Remote system: dns; (TCP||57911||25) ( -- Server ESMTP [Sun Java System Messaging Server 6.2-6.01 [built Apr 3 2006]])

NOTE: I just tried something else. When I send a message to the test site from my current email, I get it returned with the above error. If I send from Gmail, or from even a government email at work, it goes through without any errors. Could this have something to do with the fact that we use Verizon SMTP to send our mail now, and Verizon is where the IP address is that the server is getting it from?
Also, the report on at says:

ERROR: I could not complete a connection to one or more of your mailservers: Could not connect without glue or A record.

falko 29th October 2007 17:00

Could be a time problem - it can take up to 72 hours until DNS changes propagate.
If it still doesn't work afterwards, I'd contact GoDaddy and ask where you went wrong in setting the glue record (I'm not using GoDaddy, so I can't help here...).

wxman 29th October 2007 17:21

I don't think it could be that because I made the changes quite a while ago. Is there anyway for someone else to test the settings for, and see if they look wrong to them?

falko 30th October 2007 18:46

This doesn't look ok:


mh1:~# dig

; <<>> DiG 9.2.1 <<>>
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35583
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;                  IN      A

;; ANSWER SECTION:            43200  IN      A

;; Query time: 233 msec
;; WHEN: Tue Oct 30 17:38:06 2007
;; MSG SIZE  rcvd: 45

mh1:~# dig ns

; <<>> DiG 9.2.1 <<>> ns
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8131
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 3

;                  IN      NS

;; ANSWER SECTION:            86400  IN      NS            86400  IN      NS      NS3.ZONEEDIT.COM.            86400  IN      NS      localhost.

NS3.ZONEEDIT.COM.      172604  IN      A
localhost.              0      IN      A        86400  IN      A

;; Query time: 197 msec
;; WHEN: Tue Oct 30 17:38:14 2007
;; MSG SIZE  rcvd: 148


wxman 30th October 2007 20:16

I checked the zone file for and removed the line with localhost. I don't even remember why I tried that. I'v also ordered a book on DNS and BIND. I think I need it.

It seems that I can send and receive to the admin@ address from and to everywhere now. I'm only getting one error when I check


Duplicate MX records

WARNING: You have duplicate MX records. This means that mailservers may try delivering mail to the same IP more than once. Although technically valid, this is very confusing, and wastes resources. The duplicate MX records are: and both resolve to

I can't seem to find where I went wrong to get that, but I guess that's better than nothing.

falko 31st October 2007 18:33


mh1:~# dig mx

; <<>> DiG 9.2.1 <<>> mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38636
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;            IN      MX

;; ANSWER SECTION:    86400  IN      MX      10    86400  IN      MX      10


;; Query time: 283 msec
;; WHEN: Wed Oct 31 17:25:00 2007
;; MSG SIZE  rcvd: 104


You have two MX records for that both resolve to the same IP address ( That doesn't make much sense. Remove one of the MX records (doesnt matter which one).

All times are GMT +2. The time now is 16:34.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.