# setting up samba as a domain controller

## madmango

I'm trying to set up samba as a domain controller for my windows machines, so I can have roaming profiles, among other things. I've followed the tutorial on the IBM website to the letter ('Setting up Samba as a PDC'), yet still cannot connect using my clients. I think it has to do with name resolution, but not sure. Here smb.conf:

smb.conf

Thanks.

----------

## madmango

I've tried to tell the windows client to connect to any variation of the domain I can think of, including:

kellerhome

kellerhome.com

theUberServer

theUberSerer.kellerhome.com

not sure if this is correct

----------

## schism39401

what error messages have you gotten?  I just went thru the same thing with samba.  here's a couple of links that helped me out.

http://www.linux.ime.usp.br/~oda/samba/htmldocs/samba-pdc-faq.html

http://www.linux.ime.usp.br/~oda/samba/htmldocs/samba-pdc-howto.html

HTH

----------

## madmango

I'm getting the same type of error as if I had typed in a nonsense domain on the client. Something like: The DNS server could not be contacted (Details: ) Could not contatct host x, the socket operation attemted to contatct an unreachable host.

Or something like that, which leads me to beleive there is a name resolution problem. I really don't want to install a DNS or mess with bind, but will if necessary.

----------

## schism39401

I could be mistaken but I think you have to have some type of dns going to pick up the domain and the computers in it. I have bind running on my samba pdc and everything is running well..Like I said I could be mistaken..

HTH

----------

## Odius

Madmango,

You will need to use either DNS or WINS in order for name resolution to work.  I would recommend aginst using WINS, since it sucks.  DNS is much better.  Are you able to connect to machines by thier IPs?  If so your problem is definitely a name resolution problem.

----------

## madmango

Yes, i can connect to the machine with the ip. I have installed bind, and am using a named server now. All I've got to go is set it up and put it in a chroot jail.

Here goes...

----------

## madmango

Hmm.

Okay, I'm not going to set up bind in a chroot jail, that's too complicated, and a bit of overkill.

What I really want to do is have named host a name on the internal network, the addresses are 10.152.2.0 and 10.152.3.0 (eth0 and 1), but not disturb the internet (local interfaces only).

I'm not sure how to setup named.conf.

Bind is installed, and I can ping localhost from both the gentoo box and the windows boxes (although on the windows ones, it interprets the localhost to be itself, i think this is right).

----------

## grant.mcdorman

Look for a DNS proxy. There are two that may do: dnrd and dnsmasq. Both can bind to specific interfaces (i.e. not appear on your Internet connection) and will look in the localhost file first. With these, you set up one host with all the host names in /etc/hosts, run one of the proxies on it, and then point all the other hosts (both Winder and Linux) at it. It doesn't even have to be the machine with the physical Internet connection (i.e. firewall) as long as it can talk to your ISP's DNS server(s).

I use dnsmasq, personally.

dnsmasq is in Portage. Don't know about dnrd.

dnrd: http://users.zoominternet.net/~garsh/dnrd/

dnsmasq: http://www.thekelleys.org.uk/dnsmasq/doc.html

Edit: Both are a lot simpler to set up than bind (or one of the workalikes, such as djbdns).

----------

## madmango

swell!

I've set up dnsmasq, you're right, it really IS easy to config. Now I've got my small, non-internet network running with dhcp and dynamic-dns.

Okay, now I want to hook it to the net.

This would've been easy using the Gentoo box as a router, but my dad's work requires that a hardware linksys router be used. So this is what I want:

```

                                                   Internet

                                                       |

                                                       |

                                         Linksys Router (wireless)

                                               |                           |

                                       Gentoo Server       Win XP Client

(wireless client): Gentoo Desktop

(wireless client): Win XP

(wireless client): Win2k

[lots more wireless clients]

```

I don't want remote internet clients to be able to access my dhcp or my dns or my apache server, otherwise extra charges would be incurred. However, I obviously still want my internal network to access these services.

The server has a statically assigned ip address on eth0 (10.152.2.0). My ISP won't allow static addresses, and assignes ones like 68.192.x.x. I'm assuming the router will take care of NAT. Is this a correct assumption?

Ultimately, is this possible?

To make matters worse, samba still dosen't work. I get a DNS operation refused error when trying to join my domain. Harrumph.

----------

## madmango

anyone?

----------

## MrPyro

How many IP addresses is your ISP giving you? Because if it's only one, you are going to have to set up routing/NAT yourself. One possible solution would be to set up a system where the Gentoo box acts as a gateway between the internal network and the router:

                          eth0            eth1

Linksys Router ---> Gentoo Box ---> wireless hub ---> internal network

Then DNS, DHCP, Apache etc could all be configured to only listen to requests from the internal network card (eth1)

----------

