# How do I set up a DNS server?



## tk4two1 (Aug 8, 2002)

I would like to setup a dns server in my network so I can use ip networking between Mac and PC.  I would like to have it set up so that a user could just type in a hostname rather than ip address and have a hosts file on a DNS server.  I'm sorry if I am being redundant but I am quite confused.  Hopefully someone will understand what I am trying to do.


----------



## lethe (Aug 8, 2002)

well setting up a name server means just having the correct config files, and then run /usr/sbin/named.  setting up custom zone files might be a little complicated for your needs, however.  you don t really need to have a name server just to translate hostnames to IPs.  /etc/hosts or NetInfos equivalent can do it for you.

here are some DNS how-tos, if you really do want to set up a DNS server.

here is a thread discussing making your OSX machine recognize your custom hostnames, and here is a HOWTO thread on the same.

be aware that if you do choose the second hostnames method, instead of DNS, you would have to edit the hostnames on both (or all) machines on your network, which would be automatic if you had a DNS server.  if you have only very few machines on your network, you should much prefer the easier method of editing hosts files.  also, i have no idea where windows stores its hosts file, but its there somewhere.  if you run some form of UNIX on your PC (other than darwin), then it can be found at /etc/hosts


----------



## theed (Aug 9, 2002)

dude, if you're talking about 2 machines seeing each other, you want to edit the hosts file on the windows machine, and on Mac OS X.1 you open up netinfo and make duplicates of the localhost entry in the machines category, filling in information as appropriate to make the entries correct and meaningful.

Setting up real DNS (using bind anyway) is a real pain in the butt.  You don't want to do that.  BIND is industrial class, and way too painful for individual use.  If someone knows of something simpler ... is there a simpleDNS or something out there?  MacDNS for mac OS 9 was Sweet.  Is there a X replacement?


----------



## tk4two1 (Aug 9, 2002)

I have 12 Macs and 4 PC's.  I would rather not edit each config file on each machine.  I have a spare mac that I could run OS X on that I want to use as a DNS machine. I just need to know how to set it up.  I will check the links that lethe has left for me and see if that helps.


----------



## krokodilen (Aug 9, 2002)

you need BIND to set up a dns server.

it's quite easy if you got a OSX server,
just edit the contents in var/named

and named.conf in etc.


I'm sure you can run BIND on regular OSX aswell, but it's not installed by default so you have to get the packages.


----------



## lethe (Aug 9, 2002)

au contraire.  bind is installed by default on OSX client, although there is no default configuration (i.e. there is no /etc/named.conf).  but you don t have to download/install.  just create a configuration file.


----------



## krokodilen (Aug 9, 2002)

aha... well in osx server u can turn it on and off from the gui,
you probably need some extras for that...


----------



## lethe (Aug 9, 2002)

krokodilen:  i sometimes wonder what exactly the differences between OSX client and OSX server.  OSX server has a GUI frontend to setting up NI domains, and now im learning that it has GUI frontend to bind, but for the most part, the underlying software is identical?  



tk4two1:  after you figure out how to make your named.conf file, and your zone files, then you should do the OSX specific stuff: make an entry in /etc/hostconfig called NAMESERVER, and make it a network startup item.

here is apples page on how to make a startup item, or you can use their samba script as an example template.

for setting up DNS, those links from TLDP should provide enough info, but i ve never used them, instead i used DNS and BIND from oreilly associates.  let us know how it goes!


----------



## krokodilen (Aug 9, 2002)

yes the difference is more or less that macosx server comes with all the server stuff preinstalled, some extra features and a GUI.

But if you're skilled enough and got the time u can do everything on OSX as you can do on OSX server...


----------



## tk4two1 (Aug 13, 2002)

> _Originally posted by lethe _
> *after you figure out how to make your named.conf file, and your zone files, then you should do the OSX specific stuff: make an entry in /etc/hostconfig called NAMESERVER, and make it a network startup item.*



This is what I need to know how to do. How to configure my named.conf file, as far as zones there is only one so it is no big deal there.  Is there some kind of idoit proof guide to doing this? Because I am a bonified tard when it comes to this.


----------



## krokodilen (Aug 13, 2002)

can send you some example files.

basically you just got to switch

example.com into mydomain.com


----------



## tk4two1 (Aug 13, 2002)

> _Originally posted by krokodilen _
> *can send you some example files.
> 
> basically you just got to switch
> ...



Sounds good, Send me a PM or if you use AIM you can message me, I'm tk4two1. if any one comes across some step by step instructions that would be great to.


----------



## kjsosx (Oct 6, 2002)

i am wanting to do the same thing as tk4two1. I have about the same number of machines (14 macs, 4pcs) and i just want to run this for name resolution to the server for ease of use for the users. i asked xserve support at apple and they directed me to article #106853 in the kbase. seemed pretty simple until i restarted and went to the server settings to start DNS services.  the module under the network tab was gone! 

does anyone know why this would happen?


----------



## Excalibur (Oct 7, 2002)

If you want a GUI for bind, and more. Try Webmin.

http://www.webmin.com/ 

You can control basically the entire machine via the browser. This runs on an *NIX variant including OSX. Enjoy


----------



## bluehz (Oct 7, 2002)

Since you are just starting a new DNS server you might want to take a look at djbdns:

http://cr.yp.to/djbdns.html

This is a BIND replacement suite that is much more secure than the traditional BIND installation. The setup is fairly easy (although I can not guarantee it runs on OSX - I suspect it will be fine). Anyway - you look at it - DNS setup is always a bit mindboggling. I run DJBDNS on a linux box for my Mac OS LAN. Mainly because I don't want to waste a fulltime mac for meanial tasks like DNS, web, mail, etc.


----------



## legacyb4 (Oct 7, 2002)

Not to mention a very, very twisted non-standard Apache configuration and associated files... the normal httpd.conf file is there, but everything that the GUI configures is saved in a separate file and there are warnings all over telling you to be careful or you might break something. What's even more of a pain is that the "combined" log format doesn't work with the built-in stats tools very well so you have to choose between using Apple-supplied connection/bandwidth measuring tools or other web analysis tools available on the Web.



> _Originally posted by krokodilen _
> *yes the difference is more or less that macosx server comes with all the server stuff preinstalled, some extra features and a GUI.
> 
> But if you're skilled enough and got the time u can do everything on OSX as you can do on OSX server... *


----------

