DNS fix for local name resolution

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

DNS fix for local name resolution

Post 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.
belainex
Posts: 1
Joined: Fri Nov 06, 2009 8:33 am

Re: DNS fix for local name resolution

Post 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
Last edited by belainex on Sat Nov 14, 2009 3:32 am, edited 1 time in total.
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: DNS fix for local name resolution

Post by mightyohm »

Open system preferences -> Network and the DNS server should be listed under your subnet mask and router.
Attachments
network.jpg
network.jpg (69.91 KiB) Viewed 8328 times
Post Reply