Page 1 of 1

DNS fix for local name resolution

Posted: Mon Sep 14, 2009 11:43 am
by mightyohm
I have been troubleshooting various DNS issues on my local network this week, and I made an observation that may help other folks who want local DNS resolution working on their router.

My router is set to use DHCP on my wireless LAN. I am using a hacked Linksys router running DD-WRT, which allows you to set local hostnames via dnsmasq. So instead of trying to remember IP addresses, I can ping each of my computers via their assigned hostname instead. Handy.

I noticed that I could ping hostnames outside of my network (ie. google.com), but not hosts on the local LAN (ie. macbook or macbook.home). When I looked at the contents of the /etc/resolv.conf file, I saw:

Code: Select all

nameserver 127.0.0.1
I'm not sure why this wasn't being set correctly, but it turns out that /etc/resolv.conf is actually a symbolic link to /tmp/resolv.conf. In the same directory, there is also /tmp/resolv.conf.auto, which contained:

Code: Select all

search home
nameserver 192.168.24.1
which are the correct settings for my LAN.

I simply deleted the symbolic link and created a new one to resolv.conf.auto instead:

Code: Select all

ln -s /tmp/resolv.conf.auto /etc/resolv.conf
and now DNS resolution for hosts on my local LAN is working as it should, even after a reboot. I'm not sure if this is the right way to fix this (the symbolic link may be erased by a script later), but it seems to be working for me.

Re: DNS fix for local name resolution

Posted: Mon Nov 09, 2009 10:39 pm
by belainex
How to find dns server for MAC computer? My xbox live isnt working and its saying i need to confirm my dns code. How do i find this?
_______________________
external keyword tool ~ keyworddiscovery.com ~ keycompete.com ~ compete.com ~ webmasterworld.com

Re: DNS fix for local name resolution

Posted: Mon Nov 09, 2009 11:21 pm
by mightyohm
Open system preferences -> Network and the DNS server should be listed under your subnet mask and router.