Hi,

I am using sysprep to install Windows XP on computers in computer
laboratory at my school.
My problem is that each box have same computer name or randomly
generated one by sysprep. I would like to have specific hostname on
each box based on it's FQDN from DNS server. I figured out that I
should use WMI for that and rename method from W32_ComputerSystem
Class. But I don't know how I can resolve hostname from IP/FQDN. Could
anyone show me the way to resolve the problem?

P.S. Sorry for my poor english

--
Maciej Nadolski

Re: Get Hostname from FQDN from DNS by Jim

Jim
Wed Jul 12 12:29:12 CDT 2006

why does a DNS record exist if the computer isnt named yet?
if a dns record has already been created, the i would imagine you already
know the fqdn.




"Maciej Nadolski" <krecik@NOSPAM.go2.pl> wrote in message
news:e93a4j$f4c$1@nemesis.news.tpi.pl...
>
> Hi,
>
> I am using sysprep to install Windows XP on computers in computer
> laboratory at my school.
> My problem is that each box have same computer name or randomly
> generated one by sysprep. I would like to have specific hostname on
> each box based on it's FQDN from DNS server. I figured out that I
> should use WMI for that and rename method from W32_ComputerSystem
> Class. But I don't know how I can resolve hostname from IP/FQDN. Could
> anyone show me the way to resolve the problem?
>
> P.S. Sorry for my poor english
>
> --
> Maciej Nadolski



Re: Get Hostname from FQDN from DNS by Maciej

Maciej
Thu Jul 13 15:01:50 CDT 2006

Jim wrote:

> why does a DNS record exist if the computer isnt named yet?
> if a dns record has already been created, the i would imagine you
> already know the fqdn.

I am cloning disks to computers in computer laboratory. FQDNs are
already in DNS and I would like to set to each of these computers its
proper hostname (computername - this where you set workgroup/domain
also) based on DNS.. Each of these computers have its unique IP from
DHCP. Now, acording to this IP i would like resolve hostname and set
proper one.

I think that Visual Basic insted VBScript will be better to achieve this
- GetHostEntry() method. Am I right? Is there a simpler way?

--
Maciej Nadolski

Re: Get Hostname from FQDN from DNS by Maciej

Maciej
Mon Jul 17 05:02:36 CDT 2006

Maciej Nadolski wrote:
> Jim wrote:
>
>> why does a DNS record exist if the computer isnt named yet?
>> if a dns record has already been created, the i would imagine you
>> already know the fqdn.
>
> I am cloning disks to computers in computer laboratory. FQDNs are
> already in DNS and I would like to set to each of these computers its
> proper hostname (computername - this where you set workgroup/domain
> also) based on DNS.. Each of these computers have its unique IP from
> DHCP. Now, acording to this IP i would like resolve hostname and set
> proper one.
>
> I think that Visual Basic insted VBScript will be better to achieve this
> - GetHostEntry() method. Am I right? Is there a simpler way?
>

Ok. I'm using GetHostEntry() method. Problem is that when I try to
resolve my own IP address the GetHostEntry method returns my
Computername insted of FQDN resolved from DNS. Can I force somehow
GetHostEntry() to resolve my hostname from DNS instead returning my
Computername?

--
Maciej Nadolski

Re: Get Hostname from FQDN from DNS by Jim

Jim
Tue Jul 18 09:24:14 CDT 2006

no one understands what youre talking about. thats why you get no answers.
your FQDN is simply your computername (netbios hostname) with your domain
membership appended to it.
so if you know the computer name, and you know the domain name... you KNOW
the fqdn


"Maciej Nadolski" <Maciej.Nadolski@cs.put.poznan.pl-NOSPAM> wrote in message
news:e9fn8i$p6a$1@atlantis.news.tpi.pl...
> Maciej Nadolski wrote:
>> Jim wrote:
>>
>>> why does a DNS record exist if the computer isnt named yet?
>>> if a dns record has already been created, the i would imagine you
>>> already know the fqdn.
>>
>> I am cloning disks to computers in computer laboratory. FQDNs are
>> already in DNS and I would like to set to each of these computers its
>> proper hostname (computername - this where you set workgroup/domain
>> also) based on DNS.. Each of these computers have its unique IP from
>> DHCP. Now, acording to this IP i would like resolve hostname and set
>> proper one.
>>
>> I think that Visual Basic insted VBScript will be better to achieve this
>> - GetHostEntry() method. Am I right? Is there a simpler way?
>>
>
> Ok. I'm using GetHostEntry() method. Problem is that when I try to
> resolve my own IP address the GetHostEntry method returns my
> Computername insted of FQDN resolved from DNS. Can I force somehow
> GetHostEntry() to resolve my hostname from DNS instead returning my
> Computername?
>
> --
> Maciej Nadolski



Re: Get Hostname from FQDN from DNS by Johnny

Johnny
Mon Aug 21 05:23:02 CDT 2006

The only way what you ask for makes sense is if you have a static DNS server
with names for the IPs in your DHCP scope already named. The FQDN could then
be different from the FQDN on the machine.

If this is the case, then try the following. Have your script run a dos
nslookup command with the IP you have and pipe the output to a text file.
The look for the line with the name: and use the Split command to seperate
out the parts of the line you want. This isn't a pretty solution but it
should do the trick.

Keep in mind that since you are running DHCP, under certain circumstances,
you will end up with duplicate names on your network. If you manage the DHCP
server, you can make the lease time a long time to help reduce the risk of
this happening. You will then also have to manually maintain the DHCP leases
if you have too many changes in a short period of time.

Good luck!

Johnny