Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

covertsurfer

macrumors 6502a
Original poster
Jan 18, 2007
579
7
I have a iMac at home with Snow Leopard installed.

I have a VPN that allows me to connect to my work network.

This is all fine but if I try and ping or do VNC to a PC on our network it cannot resolve computer names only the IP Address of those computers.

I do not know the IP Addresses only the PC Names, is there anyway to get my iMac to resolve the PC Names, its driving me nuts.

Thanks
 

calderone

Cancelled
Aug 28, 2009
3,743
352
You will want to make sure you have the DNS server IP addresses for your work network. If the machines are bound to a domain (I assume they are) you should also add the domain to your search domains.


Typically, the VPN should pass this information onto you, but you can check in the advanced VPN settings.


See the attached image. Here the DNS server is configured to 192.168.1.2 and the search domains are work.org and local.

So, you want to get to a machine whose name is covertsurfer.

When you try to connect to covertsurfer via VNC, say vnc://covertsurfer, it will go out to the DNS server and get the IP, it will also append the search domains if it does not get an ip returned.

So, for example if your machine's name is really covertsurfer.work.org it will check that name with the DNS server. The local search domain is used by bonjour, so if you wanted to connect to any Mac you would be able to.

Now, if for some reason they do not use DNS at your job you would have to know the IP address as there would be no way to resolve names.

Hope that helps. See the attached image. Click advanced when viewing your VPN connection in System Preferences --> Network. And click the DNS tab. Do it while you are connected and see if there are any light gray fields there already, so would be settings pushed by the VPN server.
 

Attachments

  • Screen shot 2009-10-17 at 10.48.51 AM.png
    Screen shot 2009-10-17 at 10.48.51 AM.png
    43.4 KB · Views: 492

covertsurfer

macrumors 6502a
Original poster
Jan 18, 2007
579
7
Thanks however yhe PC's I need to connect to are only in a workgroup.

I tried addin g the domain that exists in the company and local but no use.
 

covertsurfer

macrumors 6502a
Original poster
Jan 18, 2007
579
7
if I do a ipconfig on the PC's they do have a DNS Suffix so I tried adding that to the VPN Settings but no luck
 

calderone

Cancelled
Aug 28, 2009
3,743
352
What is the DNS server they are using?

It seems that you may not be able to resolve names if there is no DNS server with records for your machines. IP might be your only hope.

When you are on a PC, can you resolve another PCs name? For example with a ping?
 

covertsurfer

macrumors 6502a
Original poster
Jan 18, 2007
579
7
I can resolve another PC name from a ping. There is also a IP address in the DNS Server section in VPN Advanced settings.

The DNS suffix from a ipconfig is domain.local
 

kfordham281

macrumors 6502
Dec 4, 2007
432
1
I have a similar issue as the original poster. As a workaround, I use my IP and connect to my work PC and then use that PC to connect to names if I don't know their IP. It's something to do with DNS but I've never cared enough to look into why it's happening. The workaround works well enough and I'm since I'm only using it a handful of times a year, the issue hasn't been worth my time.
 

belvdr

macrumors 603
Aug 15, 2005
5,945
1,372
It sounds like you don't have an internal DNS server and the PCs are using NetBIOS name-to-IP mapping in order to resolve (i.e. not DNS but similar to WINS). I would recommend what the poster above does, and RDP to your internal PC using IP, and then use it to connect around.
 

calderone

Cancelled
Aug 28, 2009
3,743
352
One more thing, if there is a WINS server (I am doubting this) you can try this applescript.

Code:
display dialog "Please enter the IP address of the WINS Server:" default answer ""
set winsServer to the text returned of the result
display dialog "Please enter the NetBIOS name of the computer:" default answer ""
set vncName to the text returned of the result


set vncIP to (do shell script "nmblookup -U " & winsServer & " -R " & vncName & "| grep '<00>' | awk '{print $1}'")
tell application "Finder"
	open location "vnc://" & vncIP
end tell

It will prompt for the WINS Server and machine name. You can get the WINS Server from Windows machines (I forget where).

If you just want the IP, and not vnc, pop this into terminal:

Code:
nmblookup -U WINSSERVERIP -R machineName | grep '<00>' | awk '{print $1}'

Just put the WINSSERVERIP and the machineName in the appropriate place.
 

covertsurfer

macrumors 6502a
Original poster
Jan 18, 2007
579
7
I tried the applescript with a computer name I know the IP of and it started a screen sharing app with the correct IP address however it never connected for some reason. The VNC server on the PC is RealVNC so not sure if there is configuration issues?

The terminal script ran and returned the IP correctly, thanks!

Will I have to run this in the future to get an IP as there is no other way to configure the VPN settings?

Thanks for your help so far!
 

foshizzle

macrumors regular
Oct 17, 2007
240
0
Had this issue. Fix was to change my home IP range.

ie. at work it's 192.168.1.xxx
at home it was the same, so I changed home to 10.0.1.xxx

works everytime now, no issues. It is a simple change in your router config (unless you have an incredibly cheap router). Mine is an AEBS.

I remote desktop into machines using their domain name, and connect to SMB shares same way.
 

covertsurfer

macrumors 6502a
Original poster
Jan 18, 2007
579
7
My work IP range is 172.16.... and my home is 192.168 so they are already different do I don't think that will work.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.