Automatically get nameservers

Nathan Vidican nathan at vidican.com
Tue Jan 9 14:56:08 UTC 2007


George Vanev wrote:
> I have a FreeBSD 6.1 box for a gateway.
> It connects to ISP via pppoe.
> In /etc/ppp/ppp.conf i have this line:
> enable dns
> so I have the necessery nameserver-s in /etc/resolv.conf
> So far, so good...
> I want Windows client machines, connected to the FreeBSD box
> to get the nameservers automatically.
> Can you tell me how this may be done?!
> Regerds
I think what you're looking for is DHCP, (Dynamic Host Configuration 
Protocol), which will enable you to serve your windows clients on the 
network with all of their network configuration, including but not 
limited to: ip address, gateway, subnet mask, dns servers, netbios name 
servers, etc. You can install a dhcpd server from within the ports 
collection, or via package if you'd prefer. A DHCP server will allow the 
FreeBSD machine you've setup as an internet gateway to act almost 
identically to the commercially available dsl/cable routers. I'd suggest 
isc-dhcp3-server, available in the ports collection under the 'net' 
category, you can install using the following commands on a >= 
6.1-RELEASE machine, (assuming you have the ports collection installed):

cd /usr/ports/net/isc-dhcp3-server/ && make install

cp /usr/local/etc/dhcpd.conf.sample /usr/local/etc/dhcpd.conf && vi 
/usr/local/etc/dhcpd.conf

mv /usr/local/etc/rc.d/isc-dhcpd /usr/local/etc/rc.d/isc-dhcpd.sh

echo 'dhcpd_enable="YES"' >> /etc/rc.conf

sh /usr/local/etc/rc.d/isc-dhcpd.sh start

Good-luck, read up and come back with any further questions if need be, 
but it seems like DHCP will solve your problem adequately. All you'll 
have to do from the windows machines, is set them to automatically 
configure themselves via DHCP (which is the default setting).

--
Nathan Vidican
nvidican at wmptl.com
Windsor Match Plate & Tool Ltd.
http://www.wmptl.com/


More information about the freebsd-questions mailing list