DNS Services on OS X Server (Panther)

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
DNS can and does mean | Domain Name System | Domain Name Server

DNS is normally one of the most misunderstood features of an OS X Server setup.

DNS is primarily to make 'humans' be able to navigate around the Internet a bit easier. Everyone can remember http://www.google.com and http://www.amazon.co.uk but not many people would remember http://207.171.166.149 (Amazon) and http://66.102.9.99. (Google). In most web browsers you don't have to type in "http://" it gets added for you. In some you don't have to type in the "www" bit either. In Safari you can just type in apple or amazon or mac-help and you will be transported to www.apple.com www.amazon.com or www.mac-help.com. Only works for .com addresses !

DNS Servers are in essence like telephone directories, (they are an active distributed database) ie you ask for a web site in your web browser this then sends a request to a Domain Name Servers this then translates the request into an IP address which then allows your computer to request the web page from that server. Domain Name Servers can translate from an IP address to a name and back again (reverse lookups).

Most 'users' experience of DNS is on their home computer. When you sign up to an ISP (Internet Service Provider) they will normally give you some information to allow you to use their service, how to set up your modem etc. Amongst this will be 1 or 2 DNS IP Addresses. Without these, if you type in www.bbc.co.uk into your web browser then it would give an error saying that it couldn't be found if however you had typed in the IP address that 'resolves' to the Amazon web server 207.171.166.149 then you would go straight to the page. Sometimes DNS servers can be down and when you type an address into your web browser it won't be found. I find it's always best to have a couple of IP addresses written down on your Mac somewhere...then if you can't access any web sites type in one of the IP addresses then if it works you know your ISP DNS Servers are currently down.

One handy tip to find out the IP address of your favourite websites, go to your Applications folder ---> Utilities Folder ---> Network Utility. Open up Network Utility and go to the lookup tab...then enter in the domain name ie www.amazon.co.uk and then hit return...this will then give you the IP address ! Lookup works both ways...type in an IP address and it will tell you the host name etc...Network Utility has a lot of good functions if you need them !!!

Anyway back to DNS on the OS X Server Software...

Mac OS X Server 'can' be a Domain Name Server, that's to say if set up correctly it will translate IP addresses to names and also translate names to IP addresses.

This is implemented by using 'Zone Records'. Zone Records are text files that are kept on the server with the relevant IP address and the matching 'name'.

There are lots of different types of Zone Records...two types you must implement are forward and reverse records.

To start with we will need the IP Address of the server and it's host name. We will also need the router address and the net mask, If you are unsure of either of these, IP address can be found by typing :

ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2

into your terminal and then press return.You can find out the host name by typing:

hostname

and then press return, into your terminal.

or you can go to the Network preference and get the info from their.

Once you have these you can now setup the Domain Name Server on your Mac OS X Server.

We will be changing our server from a 'Standalone Server' to a 'Master Server', but not until we have got the DNS Server functioning correctly ! This helps us check the DNS Server is working properly.


For this example our Server is an Xserver which we have named:

Computer: xserver
Hostname: xserver.mac-help.com
Rendevous name: xserver

To Set up Forward and Reverse Zone Records:

1) Launch Server Admin
2) Select the DNS Service from the list on the left.
3) Click the settings tab at the bottom
4) Select the Zones tab
5) Click the + button under the zones pane
6) Enter the zone name, ours is

mac-help.com.

then enter the SOA (Source of Authority, the name of the computer running the zone !)

xserver.mac-help.com.

Now enter an admin email, use a real one !

admin_no (e-mail address removed).

(the full stops at the end of each line are meant to be there, it is not a typo !)

then press OK !

7) You have now set up a name space record !

8) Now, click the + button under the records pane, whilst the mac-help.com zone is selected in the left hand pane !

9) Choose Address record from the list (A type).

10) In the Map from...we would enter the FQDN (Fully Qualified Domain Name)

xserver.mac-help.com.

11) In the Map to field...we would enter our IP address

10.0.1.1

12) Select the "Create reverse mapping record" checkbox.

13) You should now have two zone records in your zone list for the zone mac-help.com

14) Now click the 'Save' button.

15) Click the start service button !

The most common failure/error when someone is editing/creating DNS records is to not have the period at the end of each line !

This will prevent your DNS Server from functioning correctly ! Type carefully !

16) Now we need to check that we have set up this stage correctly ! Go to the network prefs pane and change the DNS server IP Address to your IP address ours would be:

(your IP address and the DNS Servers address will be the same !)

10.0.1.1

Then change the search domain to :

mac-help.com

17) Depending on what else your server is doing, I normally give it a reboot at this time, go get a coffee !

Now we need to check our work:

18) Open Terminal and type:

hostname

press the return key

this should give you the FQDN ---> ours would be:

xserver.mac-help.com

presuming this is correct (if not get another coffee, and then go and check for missing periods !)

19) Open terminal and type:

host xserver.mac-help.com

(one space after 'host')

press the return key

This should give you your IP Address ! Ours would have given:

10.0.1.1

20) Open terminal and type:

(replace IP with yours!)

host 10.0.1.1

(one space after 'host')

press the return key

This should resolve to your FQDN ! Ours would have given:

xserver.mac-help.com.

21) Pat yourself on the back your basic DNS is now setup and working correctly !

22) More coffee. Make yourself a written (pen and ink cheat sheet, or print this out and add in your settings). You don't normally have to do a lot of work with DNS and you may forget what you have done the next time you come to do something !

Now we're going to add an alias record for our Web Server ( we are presuming that this runs on the same machine!)

23) Back to the Server Admin, DNS Service.

24) Now, click the + button under the records pane, whilst the mac-help.com zone is selected in the left hand pane !

25) Select an Alias (CNAME) record from the pop up menu.

26) Add in as before, our would be:

Map from: xserver.mac-help.com.

Map to: www.mac-help.com.

27) Now press okay, then you need to stop and then restart DNS Services, personally I would just reboot !

Now we will add in the MX Records for the Mail Server

28) Back to the Server Admin, DNS Service.

29) Now, click the + button under the records pane, whilst the mac-help.com zone is selected in the left hand pane !

30) Select a Mail Exchanger (MX) record from the pop up menu.

31) Add in as before, our would be:

Map from: mac-help.com.

Map to: xserver.mac-help.com.

Order Number: 10

You could enter 1, but for future expandability most people use 10 as a start point !

You should really have another Mail Server running else where...you would then add in another MX record with the new servers details, using '20' as the next order number. What this means is, that if the 'main mail server' is offline then all the mail will go via the second MX record (mail server), the users will not know that anything is different ! And you will not loose any emails, having them bounced because mail server one is having maintenance done to it !

32) Now press okay, then you need to stop and then restart DNS Services, personally I would just reboot !


That covers most aspects...of DNS should anyone require it !!!

Without making all this sound like a waste of time, not many people 'really need to run their own "DNS Server". Have a think about what your requirements are first !

if anythings not clear let me know,

regards

Ric
 
Joined
Aug 19, 2005
Messages
5
Reaction score
0
Ric

What can I say....thank you

I have ordered the Netgear DG834, it will be here tomorrow, I have downloaded the manual and I've been reading through it.

I was going to run an OD Master, but I am not going to bother for the moment.

I will keep you posted

Pippa.
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
If you have any problems with the Netgear, let me know I have installed quite a few of them...

It has a built in Firewall, which works very well. If you have the Netgear Firewall on, you don't need to have the OS X Server Firewall on.

As a default it come with all inbound services blocked, and all outbound services open.

If you are going to run a web server or mail server, you will just need to open a couple of ports on the firewall, and direct (port forwarding) them to your Xserves IP address...again if you're not sure let us know !

Once you have it up and running make sure you change the default password !!!

regards

Ric
 
Joined
Nov 30, 2005
Messages
1
Reaction score
0
This is great. i just get lost on some of the steps. i have OS 10.4.3 server. you have the steps for OS 10.4.3 server?


Thanks in advanced!
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
Hi there and welcome !

What is it you want to do ?

Will be able to give you some Tiger server DNS tips tomorrow.

Off to the land of nod, shortly !

regards

Ric
 
Joined
Dec 21, 2005
Messages
1
Reaction score
0
I've got a bit of a different problem with my X Server. The server is slave for several domains, but the master DNS server is a Cobalt RaQ behind a PIX firewall. Some Address records are pointing to inernal private IP addresses which are correctly NATed by the PIX when the requests are UDP. But the zone transfers didn't work when I only had UDP DNS traffic allowed in the PIX for the master DNS server.

Therefore I allowed TCP DNS traffic and the X Server began to make the zone transfers, but with the problem that the zone contained the private IP address instead of the public IPs.

I see that the PIX doesn't NAT the DNS query when it is TCP traffic (I don't know why), but if I do a dig query with the "+tcp" parameter I get the private IP.

My workaround has been to creaye a cron job to replace private IP address with their corresponding public address in the ..bak zones every 5 minutes. But this isn't working properly since I believe the DNS is "activating" the zone before I do the replace.

Anyone have this same problem and found a solution? I'm thinking of creating a cron job to restart the DNS daily in order for the change to take effect.

Thanks,

Manuel
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
Hi Manuel and Welcome !

We've all been on holiday !

Will get round to this, this week, when I've caught up on all the questions...need my work head on for DNS questions...

regards and Happy New Year

Ric
 
Joined
Mar 1, 2006
Messages
8
Reaction score
0
Hello,

I have a little different problem:
I have to setup dns, because my internet connection doesn't support loopbacks to the dns of my provider, but I'm hosting a couple of domains. Everything is hosted on the same server. The router has a fixed ip.

How do I setup dns with different domains for a local network?

Thanks
shumi
 
Joined
Mar 1, 2006
Messages
8
Reaction score
0
Hello,

problem solved. Just added the zones, Now everything works as advertised :).

Next step will be to put that thing back to the DMZ ....

Thanks
shumi
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
Hi there and welcome...

I see you've worked it out !

Well done !

Let us know if there is anything else we can help with !

Regards

Ric
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,102
Reaction score
492
Go

Ric...

Excellent post/tutorial/explanation of DNS in Panther Server.

Got one for Tiger Server? ;)
 
Joined
Nov 29, 2006
Messages
2
Reaction score
0
Quote from above:
You have now set up a name space record !

8) Now, click the + button under the records pane, whilst the mac-help.com zone is selected in the left hand pane !

9) Choose Address record from the list (A type).

10) In the Map from...we would enter the FQDN (Fully Qualified Domain Name)

xserver.mac-help.com.

11) In the Map to field...we would enter our IP address

10.0.1.1

12) Select the "Create reverse mapping record" checkbox.

13) You should now have two zone records in your zone list for the zone mac-help.com



I tried this but it won't allow me to save, saying that the Zone Name is invalid... I don't understand... Could you help? I was trying to use the new domain name I purchased...
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
Hi there and welcome !

sorry for the delay, busy times !

Have you managed to get any further ?

regards

Ric
 
Joined
Nov 29, 2006
Messages
2
Reaction score
0
No... I tried it with all kinds of variations but keep getting this "invalid zone name" error. I picked up a couple of books in the meantime (Visual Quick Start, Panther Server Admin) and looking now to get "DNS & BIND" to understand all this... can you offer anything that might help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top