|
#1
| |||
| |||
| Cannot resolve Windows host names from Terminal I regularly connect my Mac to my Windows computer using Finder. However, I can't connect to the Windows computers using Terminal, Chicken of the VNC, or Remote Desktop Client - the hostname won't resolve. It works fine if I use the IP address. Problem is, I use DHCP at home and don't want to use static IP. Doesn't anyone know how to get name resolution working? Why does it work in Finder but nowhere else? I'm running OS X 10.3.6 using a Linksys WRT54G and trying to ping, VNC, or RDP to an XP host. TIA.
__________________ Titanium PowerBook G4 15" / 800 MHz / 1,000 MB / 40 GB / AirPort / Tiger 10.4.9 MacBook Core Duo / 2.0 GHz / 512 MB / 60 GB / Airport Extreme / Tiger 10.4.9 |
|
#2
| |||
| |||
| You will need a way to resolve names to IP's. I use a FreeBSD machine with named running, then dhcpd that has the mac addresses of the specific machines, and gives them specific IP's. My DNS server resolves the names. You can use /etc/hosts as well. |
|
#3
| |||
| |||
| Righto, but what I don't understand is how Finder is resolving the names but other TCP/IP applications are not (such as RDC, VNC). It seems I need the Mac to lookup the DHCP client addresses from the local DHCP server. Interestingly, my SuSE install can resolve DHCP client addresses just fine. It's only OS X having a problem.
__________________ Titanium PowerBook G4 15" / 800 MHz / 1,000 MB / 40 GB / AirPort / Tiger 10.4.9 MacBook Core Duo / 2.0 GHz / 512 MB / 60 GB / Airport Extreme / Tiger 10.4.9 |
|
#4
| ||||
| ||||
| The Finder is probably configured to use wins resolution or something similar in the Finder. What happens if you try "nmblookup windows-box-name" in terminal? The trick is to figure out how to configure hostname resolving order, and to see if you can set wins lookup as a step...
__________________ What is the robbing of a bank compared to the founding of a bank? -- Bertold Brecht |
|
#5
| |||
| |||
| nmblookup worked and gave me the IP address. Any thoughts about the hostname resolving order and getting WINS in there?
__________________ Titanium PowerBook G4 15" / 800 MHz / 1,000 MB / 40 GB / AirPort / Tiger 10.4.9 MacBook Core Duo / 2.0 GHz / 512 MB / 60 GB / Airport Extreme / Tiger 10.4.9 |
|
#6
| ||||
| ||||
| An idea, why not add to ~/.bashrc (or whatever login script you need) something like: export WINDOWS-BOX-1=`nmblookup hostname` Then you can just log in using something like ssh user@$WINDOWS-BOX-1
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD iMac G4 TFT 700 MHz | MacOS X 10.3.9 | 768 MB RAM, 40 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 Last edited by michaelsanford; December 13th, 2004 at 04:27 PM. |
|
#7
| |||
| |||
| This is all great, but I dont understand why it does not work. This is a workaround, and I dont like those. I need THE fix for this. I know in linux you can use /etc/nsswitch and put in the different methods of host resolution like this: hosts: files winbind dns I tried it but did not work. |
|
#8
| ||||
| ||||
| You could add the entry in your /etc/hosts file for that one Windows computer, or you could run a DNS server internally to resolve only the internal addresses. I have the same issues with my GNU/Linux systems when trying to access a Windows computer using the hostname. At work, I've modified the /etc/resolv.conf file on my GNU/Linux computers so that they could resolve the names to the IP addresses of the Windows computers. I've also modified the /etc/nsswitch.conf file to also search hostnames through DNS. In Mac OS X, I've usually just added the DNS nameservers manually from the Network pane in System Preferences for the Macs at work if they don't get it from the DHCP server. EDIT: Just noticed that you tried exactly what I mentioned in GNU/Linux, so you are obviously familiar with this. If you're using Tiger or earlier, remember that most everything is managed by NetInfo, so you might have to launch NetInfo Manager to make the changes. Be careful, though.....you can make some dire mistakes in there if you don't know what you're doing.
__________________ Apple iMac G5 17" (2 GHz G5) - Mac OS X 10.4.11 Apple Macintosh Quadra 650 (33 MHz MC68040) - Mac OS 8.1 Apple PowerBook Duo 230 (33 MHz MC68030) - System 7.1 "JHVH-1" (2 GHz AMD Athlon XP 2400+) - Slackware 12.1 "Kidbuntu" (2.8 GHz Celeron D 335) - Ubuntu 8.04 |
![]() |
| Thread Tools | |
|
|