If you run Linux and need to connect to a Windows computer by name and do not have a domain controller or static IPs, then you may need to use nmblookup to find the IP address and then connect to that.
Example:
mount -t cifs \\server\share share
might give you
"mount error: could not resolve address for server: No address associated with hostname"
However, if you look up the name using nmblookup, you could get the address:
nmblookup server
querying server on 192.168.0.255
192.168.0.182 server<00>
So then you can get to it by IP address instead of hostname:
mount -t cifs \\192.168.0.182\share share
You can do the same with rdesktop:
rdesktop server
ERROR: getaddrinfo: Name or service not known
rdesktop 192.168.0.182
(connects)
As a general rule, if you find you frequently have to do something, it can be useful to write a script to speed it up.
For remote desktop, I use the following as "rdp.sh":
rdesktop -g 1250x925 `nmblookup $1 | sed -e 's/querying //g' -e 's/on 192.168.0.255//g' -e 's/<00>//g' -e s/$1//g -e 's/ //g'`
the $1 says use the first variable after the script, the sed line clears everything except the IP address, the `` causes it to be executed first, and the -g variable is so it fits best on my screen.
So, to connect to server, I run:
rdp.sh server
I welcome comments, complaints, and suggestions.