# Linux DNS and MX in "Windows" environment

## vitoriung

Hi,

I am fighting with this few days already, but cannot find any solution.

I need to setup my Linux clients so I can ping and resolve names in our internal domain, lets say mycompany.net 

It works fine on Windows client; just set Primary DNS suffix  mycompany.net in "Computer name changes" and computer gets a FQDN and is capable to recieve emails from outside world to name@mywinxp.mycompany.net

It works using both DHCP or static IP:

```

C:\ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : mywinxp

        Primary Dns Suffix  . . . . . . . : mycompany.net

        Node Type . . . . . . . . . . . . : Hybrid

        IP Routing Enabled. . . . . . . . : No

        WINS Proxy Enabled. . . . . . . . : No

        DNS Suffix Search List. . . . . . : mycompany.net

                                           mycompany.net

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : mycompany.net

        Description . . . . . . . . . . . : Intel(R) 82566DM Gigabit Network Connection

        Physical Address. . . . . . . . . : 00-21-5A-C2-72-F8

        Dhcp Enabled. . . . . . . . . . . : Yes

        Autoconfiguration Enabled . . . . : Yes

        IP Address. . . . . . . . . . . . : 10.128.11.44

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 10.128.11.1

        DHCP Server . . . . . . . . . . . : 10.128.100.90

        DNS Servers . . . . . . . . . . . : 10.128.100.25

                                                    10.128.100.26

                                                    10.130.100.100

        Primary WINS Server . . . . . . . : 10.128.100.25

        Lease Obtained. . . . . . . . . . : 26 March 2010 03:26:54

        Lease Expires . . . . . . . . . . : 27 March 2010 03:26:54

C:\nslookup mywinxp

*** Can't find server name for address 10.128.100.25: Non-existent domain

*** Can't find server name for address 10.128.100.26: No response from server

*** Can't find server name for address 10.130.100.100: Non-existent domain

*** Default servers are not available

Server:  UnKnown

Address:  10.128.100.25

Name:    mywinxp.mycompany.net

Address:  10.128.11.44

```

In Linux got so far:

My settings are:

```

/etc/conf.d/net

bridge_br0="eth0 tap0 tap1"

brctl_br0=( "setfd 0" "sethello 0" "stp off" )

rc_need_br0="net.tap0 net.tap1"

config_br0="dhcp"

dns_domain_br0="mydomain.net"

dns_search_br0="mydomain.net"

/etc/resolv.conf 

# Generated by resolvconf

search mydomain.net

nameserver 10.128.100.25

nameserver 10.128.100.26

nameserver 10.130.100.100

/etc/samba/smb.conf

workgroup = workgroup

netbios name = sablnx64

wins server = 10.128.100.25

dns proxy = yes

map to guest = bad user

security = user

encrypt passwords = yes

smb passwd file = /etc/samba/private/smbpasswd

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

```

I can ping sablnx64 from Windows client, but not sablnx64.mycompany.net

From sablnx64 I can ping all Windows clients and their FQDN, but cannot resolve the name from linux to linux.

What could I be missing in my configuration?

----------

## bombcar

You're trying to get your Linux box to talk to the DHCP server such as to automatically update the dynamic DNS?

I've never got it to work, but by default my logs show that it seems to try.

----------

## disi

I am not sure, if I understand. You want the clients to append the domain and then do netbios? Try to turn off netbios over tcp/ip on the windows clients and see if they can still ping each other...

Is there a proper dns server for the domain?

Usually you would assign the domain-suffix to the clients via dhcp and then the dhcp updates the zone on the dns server. The clients then use the dns server toresolve the hostnames for other clients.

//edit: here is a nice howto on Gentoo wiki

dhcp: http://en.gentoo-wiki.com/wiki/DHCP

bind: http://en.gentoo-wiki.com/wiki/Bind

----------

## vitoriung

 *disi wrote:*   

> I am not sure, if I understand. You want the clients to append the domain and then do netbios? Try to turn off netbios over tcp/ip on the windows clients and see if they can still ping each other...
> 
> Is there a proper dns server for the domain?
> 
> Usually you would assign the domain-suffix to the clients via dhcp and then the dhcp updates the zone on the dns server. The clients then use the dns server toresolve the hostnames for other clients.
> ...

 

I tried to disable netbios over tcp, renamed Win client and restarted, computer name cannot be found on the network even though it got assigned WINS server IP from DHCP. 

Enabling Netbios allows ping both computer and computer.mycompany.net straight away.

So I have to setup Netbios option somewhere, so far I found I can set this in dhcpd or nmbd, but these are server solutions, my linux box is just client in mycompany.net, so I don't want run any services like DHCP server. 

However maybe nmbd could do the job for this?

I didn't reply for a while because I am workarounding this using virtual Windows server used as a SMTP server forwarding emails to my linux mail servers, but I'd like to find the resolution, so my Linux servers will be able to receive emails straight from our main email gateway.

----------

