Re: Modifying IP address by modifying the registry programatically

From: Kent W. England [MVP] (kwe@mvps.org)
Date: 08/13/02


From: "Kent W. England [MVP]" <kwe@mvps.org>
Date: Tue, 13 Aug 2002 09:49:11 -0700

The maintenance of the DNS information and its mapping to IP addresses
is most often separate from the assignment of IP addresses, particularly
if you are manually setting IP addresses and not using a DHCP server.

Check your settings (although I doubt that dynamic DNS is setup in your
situation. This is usually an enterprise configuration.) for TCP/IP
properties to see if dynamic DNS is enabled. Only if this is the case,
will the name-to-address mapping change when you change the IP address.
This change takes place on the DNS server, not on the host itself.

--
Kent W. England, MS MVP for Windows XP
(Please respond only in the newsgroup)
Bijesh.V.M. <bijesh_vm@hotmail.com> posted the following:
> Hi Kent,
>
> I tried the netsh command in XP. It worked properly and I am planning
> to
> invoke that from my program for modifying the IP address. Thanks a
> lot.
>
> I have certain doubts with regard to the "netsh" command. Here are the
> experimental steps  done by me.
>
> (1) Used the "netsh -c interface dump > p.txt" for copying the network
> configuration information to the file.
> (2) Modified the IP address in the file by editing it.
> (3) Used the "netsh -f  p.txt" command for setting the updated config
> information.
>
> Now, the new IP address is set for the machine (let it be Machine A).
> I checked this by
> pinging the new IP address from another machine (Machine B)in the
> network. It
> worked.
>
> But, when I pinged using the host name instead of IP address, it
> failed.
>
> Here is the info with respect to the steps undertaken after the host
> name ping failure:
>        (a) I tried the "netconfig flushdns" command for updating the
> DNS
>            cache  of the machine (Machine B). But the hostname pinging
> failed
>            again.
>        (b) I tried the "netconfig registerdns" also, and then pinged
> again, but with negative result.
>        (c) I tried the pinging after restarting Machine B, it was
>            successful.
>        (d) Also I got pinging successful without any restart, when I
> tried
>            ping after about 20 minutes.
>
> Now I came to the following conclusions
>        (a) Netsh command makes it possible to change the IP address
> without
>            restarting the machine.
>        (b) But the changed IP address and its association with the
> host name is not updated to the rest of the machines in the network.
>        (c) Every machine in the network updates the IP configuration
>            periodically
>
> Here are my further queries.
> (1) Could you provide the details on, where to look for information
> regarding the DNS cache flushing and related things. Any site?
> (2) Also, Is there any command similar to "netsh" in Windows NT 4.0?
>
> Thanx in advance.
>
>
> Bijesh"Kent W. England [MVP]" <kwe@mvps.org> wrote in message
> news:<Ognb6yXQCHA.2688@tkmsftngp13>...
>> I didn't correlate this thread with any other. So long as he
>> understands that netsh is there if he needs it ...
>>
>> --
>> Kent W. England, MS MVP for Windows XP
>> (Please respond only in the newsgroup)
>>
>> Roger Abell [MVP] <mvpNOSPAM@asu.edu> wrote:
>>
>>> "Kent W. England [MVP]" <kwe@mvps.org> wrote in message
>>> news:eNM30i0PCHA.1648@tkmsftngp08...
>>> netsh interface /?
>>>
>>> --
>>> Kent W. England, MS MVP for Windows XP
>>>
>>> I totally agree Kent, but Bijesh seems to have rejected
>>> the mention of using netsh made in his earlier thread.
>>> netsh would be the way to avoid the interactions of
>>> the reg keys.


Relevant Pages

  • Re: Redirect dns or iis?
    ... I'd recommend you use DNS to provide the mapping of host name to IP ... or via a dummy redirect html page. ...
    (microsoft.public.windows.server.dns)
  • Setting Alternate DNS server with NETSH command ???
    ... I can't see a way to use NETSH to set the alternate DNS server ... netsh interface ip set dns "Local Area Connection" static 192.168.1.1" ...
    (microsoft.public.win2000.networking)
  • Re: Script to Update DNS DNSServerSearchOrder
    ... I've used WMIC and Netsh but they don't seem to have this option available. ... but reset the order of the IPs. ... As I have multiple sites and the boxes use the local DNS as Primary, ... netsh command to add DNS servers instead of just adding a static listing of ...
    (microsoft.public.windows.server.dns)
  • Re: SOMEWHAT URGENT: Priority of MX records
    ... typically DNS includes both a forward zone and a reverse zone. ... forward does the host name to IP mapping, the reverse does the IP to host ...
    (microsoft.public.windows.server.sbs)
  • how can I use netsh to remotely set and add multiple DNS server addresses
    ... Can someone help me with how to use netsh to set and add multiple DNS ... server addresses to remote PCs that are running Windows XP and Windows ...
    (microsoft.public.windows.server.scripting)