 |
 |
Using BIND on a home network
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2000
Status:
Offline
|
|
Ok, I have a few home computers setup as a network (thanks to a trusty netgear router).
I hate remembering the IP addresses for all of them. It's like birthdays... who the heck remembers when their mother is born.
So my question is, does anyone know how to setup bind so that I can just use
http://servername
rather than
http://192.168.1.142
Other than that, I don't want it to interfere. I do have an ISP for internet access, that has DNS servers, the router I would think blocks inbound DNS requests... so that's not an issue.
But other than mapping a few computers, I don't want the DNS to mess up anything.
Anyone know of a guide to doing this?
|
I always use protection when fscking my Mac... Do you?
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Location: Portland, OR
Status:
Offline
|
|
OK, let me preface this with I have never done this on OS X, but I have done it on lots of other *nixes.. I just did a quick look and /usr/sbin/named exists in Jaguar, but who knows if Apple did something strange to it..
In broad terms, what you would want to do is run named on a machine on your network that is always up and available. You would make a named.conf file that points to a zone file for some local domainname (you could use home.local, for instance) and configure it to either perform recursive lookups (do the queries itself) or forward (send all requests for domains it isn't responsible for, ie everything but home.local, to some other server.)
Now, you just build a zone file for home.local that includes all your home machine names that you want to resolve.
Then, you would add home.local to your DNS search path in the network control panel, and point all your machines to your machine running named as their DNS server.
I do this at home with a linux box, works great.
If you only have a couple of machines, though, it might be easier to just use host files... Bind is pretty simple, esp. when you only have one server, but it can take a bit to learn it the first time.
EDIT: Here is a howto that I used years ago when I first started messing with DNS: DNS HOWTO
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2000
Status:
Offline
|
|
Can you provide an example for the contents of home.local
for 3 computers
computera -> 192.168.1.2
computerb -> 192.168.1.3
computerc -> 192.168.1.4
|
I always use protection when fscking my Mac... Do you?
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Location: Portland, OR
Status:
Offline
|
|
Sure thing. I just looked in /etc/named.conf on my jaguar system, and it said that zones are stored in /var/named. So, what you could do is just make a copy of one that Apple provided:
# cd /var/named
# sudo cp localhost.zone home.local.zone
Then, add some A records to your zone for your computers. Just tack these lines onto the end of the zone file:
computera IN A 192.168.1.2
computerb IN A 192.168.1.3
computerc IN A 192.168.1.4
Now, you will need to add the zone file to the /etc/named.conf file so that it will be read when you start named. Add this to the end of the file:
zone "home.local" IN {
type master;
file "home.local.zone";
allow-update { none; };
};
Now, you should be able to start named and it should start serving the zone. Named should send any troubleshooting info to syslog, so you should be able to see the output from the daemon in the file /var/log/system.log (unless Apple changed it to go to a different file.)
As for how to get named to start when you boot, I have no idea. I am familiar with SysV type init scripts, but not the wierd hybrid BSD style startup scripts that OS X uses. Someone else might be able to help with that part.
It has been my experience that Apple tends to overwrite files like named.conf when they do OS updates, so once you get it working you will probably want to keep a copy of the files you modified in a safe place.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Nov 2002
Location: Far from the internet.
Status:
Offline
|
|
If all the computers are running X, couldn't you just use NetInfo Manager to name each machine rather than using DNS services? There is a way to do this in 9 as well, to name machines in a file where the system looks before consulting DNS. I can't remember how to do that though. You should be able to do this in NetInfo on X though. And since you don't have many machines, it would be simpler than setting up BIND.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
That possibility was covered: geekwagon mentioned setting up /etc/hosts files on the individual machines can be easier than maintaining a DNS server for smaller networks. (/etc/hosts entries are read by lookupd before NetInfo /machines entries under 10.2, so it is preferable to use the flat file rather than the NetInfo database.)
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
Am I missing something here? Are these all Macs? Isn't this exactly what Rendezvous is for?
Just use Rendezvous, and name them powerbook.local, desktop.local, g3.local, whatever.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
I operate in a heterogenous environment, ergo I run BIND.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Nov 2002
Location: Far from the internet.
Status:
Offline
|
|
Originally posted by gatorparrots:
That possibility was covered: geekwagon mentioned setting up /etc/hosts files on the individual machines can be easier than maintaining a DNS server for smaller networks. (/etc/hosts entries are read by lookupd before NetInfo /machines entries under 10.2, so it is preferable to use the flat file rather than the NetInfo database.)
I thought /etc/hosts was not perferred over NetInfo's /machines. At least, thats what I thought I read when I opened up /etc/hosts for the first time. I'm away from my mac now so I cannot check though...
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
Despite these comments at the head of the /etc/hosts/ file:
##
# Host Database
#
# Note that this file is consulted when the system is running in single-user
# mode. At other times this information is handled by lookupd. By default,
# lookupd gets information from NetInfo, so this file will not be consulted
# unless you have changed lookupd's configuration.
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
The file is in fact referenced under 10.2. The comments are incorrect, a holdover from the 10.1 version of the file. In fact, FFAgent (the Flat File Agent for lookupd) actually preceeds NIAgent (which is responsible for looking up /machines entries) in the lookup order:
Code:
gatorparrots% lookupd -configuration
...
LookupOrder: Cache FF DNS NI DS
_config_name: Host Configuration
...
More from MacWrite:
http://www.macwrite.com/criticalmass...sts-jaguar.php
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Nov 2002
Location: Far from the internet.
Status:
Offline
|
|
Originally posted by gatorparrots:
Despite these comments at the head of the /etc/hosts/ file:
The file is in fact referenced under 10.2. The comments are incorrect, a holdover from the 10.1 version of the file. In fact, FFAgent (the Flat File Agent for lookupd) actually preceeds NIAgent (which is responsible for looking up /machines entries) in the lookup order:
Code:
gatorparrots% lookupd -configuration
...
LookupOrder: Cache FF DNS NI DS
_config_name: Host Configuration
...
More from MacWrite:
http://www.macwrite.com/criticalmass...sts-jaguar.php
Ah, thanks for the info. Good to know.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|