Welcome, Guest
Please Login or Register.
Lost Password?
Re: Primary and Secondary DNS on same machine (1 viewing)
Post Reply

TOPIC: Re: Primary and Secondary DNS on same machine

#4059
JeremyReynolds (User)
Posts: 18
graphgraph
Primary and Secondary DNS on same machine 2007/03/07 19:21  
Hi Joe,

I'd like to point both ns1.mydomain.com and ns2.mydomain.com to the one Virtualmin machine. I've got 2 IP's - can you please let me know what I have to do for Virtualmin to take care of setting up ns1.mydomain.com and ns2.mydomain.com for new servers, as well as any other config needed on the server? I know about setting up slave but that's for another machine yeah?

Also, is there a list of Virtualmin variables for use in templates?

Thanks
  The administrator has disabled public write access.
#4060
kcackler (User)
Posts: 66
graphgraph
Re: Primary and Secondary DNS on same machine 2007/03/07 23:26  
1. Edit the bind configuration to set the default nameserver to ns1.yourdomain.com
2. Edit the server template for the default server, and add the following to the bind configuration:

${DOM} 38400 IN NS ns2.yourdomain.com

And make sure that 'Add above to automatically generated records' is checked.

That's virtualmin's part. You also need to configure bind and be sure and have A records on mydomain.com for ns1 and ns2.

As for variables:

${DOM} The domain name, such as foo.com
${PREFIX} The first part of the domain name, like foo
${USER} The user that owns the domain, such as foo
${IP} The IP address assigned to the virtual server, such as 192.168.1.1
${HOME} The domain user's home directory, such as /home/foo
In addition, conditional blocks like $IF-MAIL...$ENDIF-MAIL and $IF-WEB...$ELSE-WEB...{$ENDIF-WEB} may be used.


Kevin
  The administrator has disabled public write access.
#4061
JeremyReynolds (User)
Posts: 18
graphgraph
Re: Primary and Secondary DNS on same machine 2007/03/07 23:42  
Thanks Kevin...

I've done points 1 and 2 (BTW - Virtualmin creates the default ns1 line: "@ IN NS ns1.mydomain.com." - does this mean I could add "@ IN NS ns2.mydomain.com." to the server template without the "${DOM} 38400"? Or is it better to include it, if so why doesn't VM do that for default ns1 entry?

You also need to configure bind and be sure and have A records on mydomain.com for ns1 and ns2.

Not exactly sure re this - do you mean creating the ns1 and ns2 on mydomain.com at my registrar? If so, I've done that and entered both my IP's for ns1 and ns2. Or are you saying I need to do something else on the VM server?

No luck yet but maybe I need to give DNS cache the benefit of the doubt and wait and see....

Thanks for your help!
  The administrator has disabled public write access.
#4063
kcackler (User)
Posts: 66
graphgraph
Re: Primary and Secondary DNS on same machine 2007/03/07 23:57  
You need to go to the bind configuration for 'mydomain.com'

From there, create two new A (Address) records, defining what exactly ns1 and ns2 are...

Name: ns1.yourdomain.com.
Address: IP # 1

Name: ns2.yourdomain.com.
Address: IP # 2


I'm not sure why VM doesn't add the domain and expiry to the ns1 record. I never noticed until you pointed it out. It is better to include it, so for now at least, put that line as I typed it. It can only help...

Once you've added those A records to the bind conf for mydomain.com and pointed your other domains at ns1..and ns2.. things should be rolling..
Kevin
  The administrator has disabled public write access.
#4064
JeremyReynolds (User)
Posts: 18
graphgraph
Re: Primary and Secondary DNS on same machine 2007/03/08 01:00  
Thanks again Kevin. I've done that - still not working from the outside world, but is this a DNS cache thing?

Here's dig output run from server (with names and IP's changed) - does it look right?:

;[> DiG 9.3.4[> mydomain.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER mydomain.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER
  The administrator has disabled public write access.
#4066
kcackler (User)
Posts: 66
graphgraph
Re: Primary and Secondary DNS on same machine 2007/03/08 09:43  
I know that you created your nameservers at the registrar. BUT, did you point mydomain at those nameservers? Also, have you added your second IP to the server as eth0:0 (or similar?)

Your bind configuration looks alright to me(though I'm no expert)...
  The administrator has disabled public write access.
#4067
kcackler (User)
Posts: 66
graphgraph
Re: Primary and Secondary DNS on same machine 2007/03/08 09:44  
Also - did you restart bind after you made the changes? That's very important, and kind of what it looks like...

If you did restart bind, then yeah, I'd say it's some sort of cache. Try running a report on dnsreport.com and see what it returns.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.