Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 network address --> computer name

Author  Topic 

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2006-03-16 : 10:58:41
So I'm looking at Process Info in EM, and I've done a bit of a hack by providing the username into the hostname. so i cant tell the computer name. but I can see the network address. can i get to the computer name from the network address? I know these days you can get to just about any properties of any system on the network...

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2006-03-16 : 18:15:58
Want a really ugly way?

dynamically build up a NBTSTAT -A command. xp_cmdshell it. parse the results.

An example would be:
nbtstat -A 192.168.0.1

output:
Gigabit Network:
Node IpAddress: [192.168.0.1] Scope Id: []

NetBIOS Remote Machine Name Table

Name Type Status
---------------------------------------------
HANNI <00> UNIQUE Registered
MSHOME <00> GROUP Registered
HANNI <20> UNIQUE Registered
HANNI <03> UNIQUE Registered
MSHOME <1E> GROUP Registered
HANNELORE <03> UNIQUE Registered

MAC Address = 00-08-A1-77-8C-BC


telkom:
Node IpAddress: [155.239.146.132] Scope Id: []

Host not found.

... in amongst all that lot is:

HANNI <-- machine name.

Is it reliable - I don't know.
Is there a better way - I sure hope so, but it's 01:19am and I'm going to bed.

Goodluck


*##* *##* *##* *##*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-03-16 : 19:11:39
You have the IP address and want the host name? You can use PING with the -a option.

The IP address for sqlteam.com:

ping sqlteam.com

Pinging sqlteam.com [66.129.68.65] with 32 bytes of data:

Reply from 66.129.68.65: bytes=32 time=57ms TTL=109
Reply from 66.129.68.65: bytes=32 time=56ms TTL=109
Reply from 66.129.68.65: bytes=32 time=55ms TTL=109
Reply from 66.129.68.65: bytes=32 time=54ms TTL=109

The host name for IP address 66.129.68.65

ping -a 66.129.68.65

Pinging sqlteam.info [66.129.68.65] with 32 bytes of data:

Reply from 66.129.68.65: bytes=32 time=57ms TTL=109
Reply from 66.129.68.65: bytes=32 time=72ms TTL=109
Reply from 66.129.68.65: bytes=32 time=53ms TTL=109
Reply from 66.129.68.65: bytes=32 time=56ms TTL=109




CODO ERGO SUM
Go to Top of Page

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2006-03-17 : 03:38:14
hmm - don't knwo about that one - thanks Michael.

Anyone know of a "cleaner" way to do this?

*##* *##* *##* *##*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2006-03-17 : 08:11:36
no, i dont have the ip address. I have the network address: 9439add37d95
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-03-17 : 09:39:31
quote:
Originally posted by coolerbob

no, i dont have the ip address. I have the network address: 9439add37d95



OK, the sysprocesses table calls it the net_address, but it's really the MAC address. There may be a way to get it if the IP address is dynamically assigned by DHCP by looking it up in the Windows DHCP Management utility, but I don't know the exact procedure. If it isn't assigned by DHCP, I have no idea how to do it.

If you are still looking at it, you can just get the hostname from the hostname column in sysprocesses.






CODO ERGO SUM
Go to Top of Page
   

- Advertisement -