# 10.4 DNS Resolutions Woes



## andergoo (Mar 6, 2008)

Hi everybody,

I'm trying to integrate my wife's mac ibook in my home network, which consists of several windows und linux hosts. DHCP , DNS and WINS services are being provided by a router. The mac registers fine and gets all it needs through DHCP, internet and address resolution for addresses outside of the local lan work fine.

The problem: DNS resolution is not working properly for hosts in the local lan.  

Example: 'host myhost' or 'dig myhost' resolve the address correctly, but 'ping myhost' fails with the error "ping: cannot resolve myhost: unknown host"

Running tcpdump, I can see that the ping command only results in a DNS request when I tack a domain suffix on. For ex, "ping myhost.mydomain" causes a lookup, but "ping myhost" fails without even sending a request to the DNS server.

I know I could just set a domain  in the network panel, but I have no way of telling the embedded DNS server in my router to be responsible for that domain.

Isn't there a way to just make the mac simply query the DNS server?

Thanks a lot,

mike


----------



## MisterMe (Mar 6, 2008)

andergoo said:


> ...
> 
> The problem: DNS resolution is not working properly for hosts in the local lan.
> 
> ...


If I read your post correctly, then your DNS is working just fine. It seems that the _ping_ command is not responding as you want.


----------



## andergoo (Mar 6, 2008)

Sorry, poorly worded.

Ping works fine when fed an ip address, DNS works fine using host or dig - address resolution doesn't work properly. 

In other words, whatever mechanism is being used to decide how to resolve an address (lookupd ?) is choosing not to query the DNS server. 

On a Linux box, one would probably be looking at tweaking the /etc/nsswitch.conf file, but I don't have one of those on the mac.


----------



## andergoo (Mar 9, 2008)

... I'm suspecting this has to with the  mDNS provided by Bonjour. Anybody know how to force the mac to be old-fashioned and just query the the designated DNS server when an app wants an address?


----------



## macworks (Mar 11, 2008)

My feeling on this is that the mac is automatically adding ".local" when you don't have any dot syntax -- basically the same thing that andergoo is saying. I do believe, if you're an expert at DNS, you can change the Mac's behavior by adding something into the "search domains" field on each Mac.

While I realize that can be tedious, you're not really doing custom DNS properly, now are you?


----------



## andergoo (Mar 12, 2008)

Yes, that's more or less correct. Watching the interface with tcpdump, I can see that  queries to the DNS server are only made when I have entered something in  the "search domains" field. Otherwise Bonjour takes over and tries to use mDNS, which is not supported by all of my clients. I realize that the 'correct' solution would be to name my network and add the domain suffix to all of my clients, but my DNS server is embedded on the router and I have no way of telling it to be responsible for a certain domain.  
So I wanted to try to get the mac to 'just ask the DNS server, always, no matter what'..


----------



## macworks (Mar 12, 2008)

I believe you can change the default behavior on each Mac so that it does NOT look for ".local" addresses (using Bonjour) if you want. But again, that sorta defeats the purpose of DHCP and DNS --- normally you want all this stuff to "just work".

I think the cleanest solution is to run a proper DNS server OR to rename the computers that you've already given a custom name to.


----------



## Kees Buijs (Mar 14, 2008)

macworks said:


> I believe you can change the default behavior on each Mac so that it does NOT look for ".local" addresses (using Bonjour) if you want. But again, that sorta defeats the purpose of DHCP and DNS --- normally you want all this stuff to "just work".
> 
> I think the cleanest solution is to run a proper DNS server OR to rename the computers that you've already given a custom name to.



Normally even your internal network has some kind of domainname.

If you do not add one, dns will have problem resolving the name. You can have a fixed domainname added to all missing by filling in the 'search domain' to whatever it should be like localdomain.com -> mypc = mypc.ocaldomain.com. This should be the same as the DNS server expects to be the local domain.

Otherwise try ping to the full name and see if that works (thus the computername and the DNS domainname. DNS can resolve a lot of domainnames thus needs the full name to resolve properly.


Good luck, Kees


----------



## andergoo (Mar 15, 2008)

Thanks for all the great input, guys!

Aha. It appears that the DNS server on my router is uses a simple '.' als the domain name. Manually appending hostnames with a '.' works, but I haven't been able to get the mac to do that on its own. When I add '.' to the search domains field, the mac tries look up 'host..'  with 2 dots. Without 

I realize that assigning a domain name to my internal network would be the proper solution, but my router won't let me do that, and I don't really want to have another "always on" pc in the house.

Any ideas, or do I need to ditch the router?


----------



## Satcomer (Mar 15, 2008)

andergoo said:


> Thanks for all the great input, guys!
> 
> Aha. It appears that the DNS server on my router is uses a simple '.' als the domain name. Manually appending hostnames with a '.' works, but I haven't been able to get the mac to do that on its own. When I add '.' to the search domains field, the mac tries look up 'host..'  with 2 dots. Without
> 
> ...



Point your router to the DNS experts at OpenDNS.


----------



## Kees Buijs (Mar 17, 2008)

andergoo said:


> Thanks for all the great input, guys!
> 
> Aha. It appears that the DNS server on my router is uses a simple '.' als the domain name. Manually appending hostnames with a '.' works, but I haven't been able to get the mac to do that on its own. When I add '.' to the search domains field, the mac tries look up 'host..'  with 2 dots. Without
> 
> ...



The extra point is normal, it is the separator between the domain-name (.) and the device name. You could try a space in the search filed, but it is better to specify a domain name (maybe the router name).


Good luck, kees


----------



## mvcube (Mar 23, 2008)

Sometimes it helps to just add a dot "." at the end of the name.

But I suspect that the embedded DNS uses some domainname and broadcasts this name to the DHCP clients if they are prepared to accept the information. Can you check what your Windows or Linux clients send to the DNS when they resolve a name?

Why don't you set up a local DNS on one of your other (Linux) boxes? If you let it handle DHCP as well, you can control the information that goes to the clients. I've done it on my network with a W2K3 server as DHCP and DNS server. It acts as default router as well, becaus I have some local routes which must be honoured before any packet goes to the Internet. Low level IP (ICMP) messages will cause the clients to directly route their traffic to the respective adresses (routers) instead of sending everything to the server.

My website is on the domain mvcsys.de. To create a local domain, I've prepended "wehrheim." to this domain name (the city where I live). This domain is controlled by the DNS in my server.


----------

