PDA

View Full Version : bind/dns "A" record to external server


ryoken
8th July 2006, 12:34
i was wondering how you would configure (if it is at all possible) bind dns server to point its "A" record to an external mail and web server.

for example, the local network domain name is johndoe.com.au, but the registered external domain name is also johndoe.com.au. now the dns server can easily resolve internal hostnames on the local network, but if the mail and web servers are being hosted on external servers outside the local network, how would you point the "A" record in the forward zone file to the mail/web servers?

to further complicate things, the mail and web servers have dynamic ip addresses. so this means putting a 'static' ip address of the mail and web server for the "A" record may work today, but not tomorrow.

any suggestions? :confused:

falko
9th July 2006, 14:52
Did you have a look here? http://www.howtoforge.com/two_in_one_dns_bind9_views

ryoken
10th July 2006, 13:15
Did you have a look here? http://www.howtoforge.com/two_in_one_dns_bind9_views

Hi falko, thanx for your reply! yes, ive looked at the howto and other places through google. specifically, i was wondering what happens if "mail.example.com" is a dynamic ip address. coz then the "A" record in the zone file would become invalid, say tomorrow.

For example:

mail IN A 192.0.2.128 ; We have our mail server somewhere else.

But say tomorrow, the IP address of the mail server changes to 192.0.2.228? Then would this mean we would always need to change the zone file whenever the mail server IP address changes? :confused:

falko
11th July 2006, 15:39
But say tomorrow, the IP address of the mail server changes to 192.0.2.228? Then would this mean we would always need to change the zone file whenever the mail server IP address changes? :confused:
That's right. But you could write a script that checks your public IP address and changes the zone file, if necessary. You can run this script by cron, e.g. every 5 minutes or so.

ryoken
12th July 2006, 10:17
That's right. But you could write a script that checks your public IP address and changes the zone file, if necessary. You can run this script by cron, e.g. every 5 minutes or so.

ahh... thats a great idea! :D

maybe something like doing a grep (or sed?) on the dig/host/nslookup output to find out the ip address of the mail server being hosted by a 3rd party provider. then comparing that result with what is in my zone file... and if there are no differences, then leave untouched, else replace with new ip address :cool:

once a zone file is changed, will bind need to be restarted? or will it automagically notice the change and read the new ip address?

falko
13th July 2006, 14:56
once a zone file is changed, will bind need to be restarted? or will it automagically notice the change and read the new ip address?
Restart it. :)

ryoken
18th July 2006, 13:52
Restart it. :)

cheers! :cool: