get IPaddress

  • Thread starter Thread starter Doug Marks
  • Start date Start date
D

Doug Marks

The scenario is, a multihomed machine where the second NIC
is in a private LAN using the 192.168... addresses. The
DNS name for this machine is a0185-app0344-s(using
10.66.?.? class A network) the host file, for the private
LAN) is set to resolve app0344-pn to 192.168.200.44. If
you ping "a0185-app0344-s" from inside the box it resolves
to the 192.168. address, but from the outside it resolves
the 10.66 address. I have found the same results via C#
code running the "GetIPAddress" function. The problem is
that if I ping or get the IP via code for "a0185-app0344-
s" how can it resolve the private LAN IP of 192.168.200.44
when it is not associated with that machine name? This
really causes issues in one of our tools that checks IP
addresses because it runs as a service locally on each
server it always returns the private IP and I need the
public. ANY ideas???
 
In
Doug Marks said:
The scenario is, a multihomed machine where the second NIC
is in a private LAN using the 192.168... addresses. The
DNS name for this machine is a0185-app0344-s(using
10.66.?.? class A network) the host file, for the private
LAN) is set to resolve app0344-pn to 192.168.200.44. If
you ping "a0185-app0344-s" from inside the box it resolves
to the 192.168. address, but from the outside it resolves
the 10.66 address. I have found the same results via C#
code running the "GetIPAddress" function. The problem is
that if I ping or get the IP via code for "a0185-app0344-
s" how can it resolve the private LAN IP of 192.168.200.44
when it is not associated with that machine name? This
really causes issues in one of our tools that checks IP
addresses because it runs as a service locally on each
server it always returns the private IP and I need the
public. ANY ideas???

Since DNS is aware of the querying client's IP address, and there are two
records for this machine name under the zone, DNS tries to give the best
answer based on the querying machine's IP subnet.

Is this server a DNS server or a DC or both? Is there a reason this DNS, if
it is a DC or DNS server, is multihomed? Just to point out, (discussed a few
times in this group), multihoming a DC/DNS, if it is that, is very
problematic, including with some machines that serves a production app.
There are steps you can follow on this DC or server, including some registry
changes to only force the internal IP to register into DNS so only that
record responds.

If the machine is a NAT server, it would be beneficial and alot less
headaches to get a Linksys, Netgear, etc, router to perform NAT for you and
single home this server.

If you can confirm my assumptions, or able to give us an ipconfig /all, that
would help towards a diagnosis. Thanks!

--
Regards,
Ace

Please direct all replies ONLY to the Microsoft public newsgroups
so all can benefit.

This posting is provided "AS-IS" with no warranties or guarantees
and confers no rights.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
Microsoft Windows MVP - Windows Server - Directory Services

Security Is Like An Onion, It Has Layers
HAM AND EGGS: A day's work for a chicken;
A lifetime commitment for a pig.
 
This is neither a DNS or DC it is a simple application
server running the Siebel v7.0. Also, on the private LAN
configuration the checkbox "Register this connection's
addresses with the DNS" is unchecked. On the public NIC
this box is checked. The network named "VLAN" is the
private network.

As requested, ipconfig:

Windows 2000 IP Configuration

Host Name . . . . . . . . . . . . : a0185-app0344-s
Primary DNS Suffix . . . . . . . :
gldc.ad.allstate.com
Node Type . . . . . . . . . . . . : Peer-Peer
IP Routing Enabled. . . . . . . . : Yes
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . :
gldc.ad.allstate.com
ad.allstate.com
allstate.com

Ethernet adapter VLAN:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Compaq NC3134
Fast Ethernet NIC #2
Physical Address. . . . . . . . . : 00-08-02-CD-CF-
B3

DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.200.44
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . :
NetBIOS over Tcpip. . . . . . . . : Disabled

Ethernet adapter Corporate LAN:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Compaq NC3134
Fast Ethernet NIC
Physical Address. . . . . . . . . : 00-08-02-CD-CF-
B2
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 10.66.70.218
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Default Gateway . . . . . . . . . : 10.66.70.1
DNS Servers . . . . . . . . . . . : 10.64.96.194
10.64.80.220
Primary WINS Server . . . . . . . : 10.64.80.220
Secondary WINS Server . . . . . . : 10.64.96.194

Ethernet adapter Loopback:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft
Loopback Adapter
Physical Address. . . . . . . . . : 02-00-4C-4F-4F-
50
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration IP Address. . . : 192.168.200.20
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Autoconfiguration IP Address. . . : 192.168.100.23
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . :
NetBIOS over Tcpip. . . . . . . . : Disabled
 
In
Doug Marks said:
This is neither a DNS or DC it is a simple application
server running the Siebel v7.0. Also, on the private LAN
configuration the checkbox "Register this connection's
addresses with the DNS" is unchecked. On the public NIC
this box is checked. The network named "VLAN" is the
private network.

As requested, ipconfig:

Windows 2000 IP Configuration

Host Name . . . . . . . . . . . . : a0185-app0344-s
Primary DNS Suffix . . . . . . . :
gldc.ad.allstate.com
Node Type . . . . . . . . . . . . : Peer-Peer
IP Routing Enabled. . . . . . . . : Yes
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . :
gldc.ad.allstate.com
ad.allstate.com
allstate.com

Ethernet adapter VLAN:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Compaq NC3134
Fast Ethernet NIC #2
Physical Address. . . . . . . . . : 00-08-02-CD-CF-
B3

DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.200.44
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . :
NetBIOS over Tcpip. . . . . . . . : Disabled

Ethernet adapter Corporate LAN:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Compaq NC3134
Fast Ethernet NIC
Physical Address. . . . . . . . . : 00-08-02-CD-CF-
B2
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 10.66.70.218
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Default Gateway . . . . . . . . . : 10.66.70.1
DNS Servers . . . . . . . . . . . : 10.64.96.194
10.64.80.220
Primary WINS Server . . . . . . . : 10.64.80.220
Secondary WINS Server . . . . . . : 10.64.96.194

Ethernet adapter Loopback:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft
Loopback Adapter
Physical Address. . . . . . . . . : 02-00-4C-4F-4F-
50
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration IP Address. . . : 192.168.200.20
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Autoconfiguration IP Address. . . : 192.168.100.23
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . :
NetBIOS over Tcpip. . . . . . . . : Disabled

If you are able to ping a0185-app0344-s from a CMD prompt on the box itself
(interpreting your original post correctly, I hope), and from the 'outside',
(I'm assuming you mean from a machine on the 10.66 network), it resolves to
10.66.70.218?

But you want the machines on the 10.66 subnet to resolve to 192.168.200.44?

I'm not sure where this fits in from your original post?Is this supposed to be accessed by a different name as well?

Keep in mind, that your search suffix is also important here, but since you
have WINS running, and assuming H-Node, then I'm going with this being a
NetBIOS issue.

A hosts file, if only configured on that machine, only that machine will
resolve app0344-pn to 192.168.200.44. If tried from any other machine, the
name doesn't exist, because its different and uniquely created on in that
machine's hosts file.

Since you are pinging by the single name (the NetBIOS name) from a machine
on the 10.66 subnet, and all those machines are using WINS, as well as this
machine in question for the 10.66 interface, and that you have NetBIOS
disabled on the 192.168 intercace, and the WINS server is configured only on
the 10.66 interface, and since the default WINS configuration would be
H-Node, then I believe that WINS is giving you the best and only answer it
knows since that's what got registered in WINS for the name
"a0185-app0344-s", which has the 10.66 addresss registered, and not the
192.168 address.

If you want app0344-pn to resolve to 192.168.200.44 for everyone, just
create a static entry in WINS for that name and IP.

If you don't want "a0185-app0344-s" to resolve to 192.168.200.44, and not to
the 10.66 address, I would suggest to remove the WINS entry on the 10.66
interface and statically create a WINS entry for "a0185-app0344-s" giving it
the 192.168.200.44 address.

I hope I understood what you were asking and this helped.

--
Regards,
Ace

Please direct all replies ONLY to the Microsoft public newsgroups
so all can benefit.

This posting is provided "AS-IS" with no warranties or guarantees
and confers no rights.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
Microsoft Windows MVP - Windows Server - Directory Services

Security Is Like An Onion, It Has Layers
HAM AND EGGS: A day's work for a chicken;
A lifetime commitment for a pig.
 
If I ping a0185-app0344-s from my desktop (intranet
10.66... network) I resolve the 10.66 address which is
what I want. If I ping a0185-app0344-s while logged into a
session on a0185-app0344-s the IP in the reply is the
192.168...network. In the host file, which resides on 6
machines that are in the private network, I only have the
private IP address with a unique name. On the network the
DNS server only has the public network information in it.

The problem I have is, I resolve the local machine's IP
address programatically using the "GetIPbyDNS", via an
internal application running as a service on each server,
and it resolves the private address which I do not want. I
want to resolve the address that is listed in the DNS
server, the public IP. In the API call I pass the machine
name and the API is supposed to query the DNS server yet
apparently this is not the case because the DNS server has
no name resolution for any address starting with 192.168.

Any ideas???

Thanks for your responses,
Doug
 
I see. All you want is to have your GetIPbyDNS function to grab the IP from
DNS, but DNS doesn't have that address for that name. I am not familiar with
programmatically obtaining data in that matter, but would assume its using
the DNS resolver service to query for it. Can you point the machine to your
public DNS server (provided its not a DC)? Or can you programmitically
designate the public DNS in your script to use that DNS that holds the 192
addresses?

Ace


In
Doug Marks said:
If I ping a0185-app0344-s from my desktop (intranet
10.66... network) I resolve the 10.66 address which is
what I want. If I ping a0185-app0344-s while logged into a
session on a0185-app0344-s the IP in the reply is the
192.168...network. In the host file, which resides on 6
machines that are in the private network, I only have the
private IP address with a unique name. On the network the
DNS server only has the public network information in it.

The problem I have is, I resolve the local machine's IP
address programatically using the "GetIPbyDNS", via an
internal application running as a service on each server,
and it resolves the private address which I do not want. I
want to resolve the address that is listed in the DNS
server, the public IP. In the API call I pass the machine
name and the API is supposed to query the DNS server yet
apparently this is not the case because the DNS server has
no name resolution for any address starting with 192.168.

Any ideas???

Thanks for your responses,
Doug



--
Regards,
Ace

Please direct all replies ONLY to the Microsoft public newsgroups
so all can benefit.

This posting is provided "AS-IS" with no warranties or guarantees
and confers no rights.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
Microsoft Windows MVP - Windows Server - Directory Services

Security Is Like An Onion, It Has Layers
HAM AND EGGS: A day's work for a chicken;
A lifetime commitment for a pig.
 
Back
Top