HowTo Get or Change LAN Configuration on Windows Host
For some tasks in your home networking environment can be useful to know your LAN network configuration or provide change to this configuration. This short HowTo will show to you how you can do that easily on Windows host.
If you read an article about networking or tried to use some hints from internet targeted on networking, maybe you will find that those articles operates with terms as your hostname, DNS name, IP address, LAN Local IP address range, Default Gateway IP, DNS server IP etc. The base explanation of most of those terms you can find in my previous posts The IP Networking Fundamentals for Dummies and The DNS Fundamentals for Dummies then in this post I’ll expect that you understand what those terms mean.
This post explains how you can obtain those pieces of information easily with several command line commands on Windows host. For Linux users, I have provided post HowTo Get or Change LAN Configuration on Linux Host where you can find principles how to obtain same values on Linux OS.
Public IP address
Before OS dependent parts, I can briefly describe how to easily obtain a value of your public IP address. As I mentioned in my IP networking post, many providers and home networks use NAT technology to connect computers to the Internet. In this case, the computer has IP address from a private range and this IP is unavailable from the Internet. But, of course, your router or other NAT device has to have one or more public IP which is translated by NAT mechanism. Sometimes can be useful to know this IP value.
To resolve this IP, you can use your web browser and access DynDNS CheckIP service web page: checkip.dyndns.com.
This web page resolves the public IP address which generates HTTP request on the page and it is exactly your public IP address. Exception here is if you are using an public proxy server. In this case, you will see IP address of this proxy server instead of your public IP. But if you are using proxy in your LAN, then it will works clearly too.
Now, let’s start to describe OS dependent part.
Windows Network Configuration
On the Windows operating system we have very easy task, because all necessary pieces of information can be obtained by one console command:
C:\Users\winuser> ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : xp-host Primary Dns Suffix . . . . . . . : homedomain.hd Node Type . . . . . . . . . . . . : Peer-Peer IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : homedomain.hd Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : homedomain.hd Description . . . . . . . . . . . : Broadcom NetXtreme 57xx GiB Controller Physical Address. . . . . . . . . : 00-1D-09-3f-ff-ff Dhcp Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IP Address. . . . . . . . . . . . : 192.168.1.23 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 DHCP Server . . . . . . . . . . . : 192.168.1.1 DNS Servers . . . . . . . . . . . : 192.168.1.1 192.168.1.100 Primary WINS Server . . . . . . . : 192.168.1.100 Secondary WINS Server . . . . . . : 192.168.1.110 Lease Obtained. . . . . . . . . . : Saturday, July 03, 2010 3:05:42 PM Lease Expires . . . . . . . . . . : Sunday, July 04, 2010 3:05:42 AM
As you can see, all required items are available in this one dump.
Computer Related Information
First part of the dump contains common computer details, as hostname, DNS suffix, DNS Suffix search list etc.
The hostname is name of your computer. Primary DNS suffix is typically your domain name, and when you will join those two names together, you will get the FQDN of your computer. Those names you can find also on System Properties dialogue on Computer Name tab where you can modify those values too.
To get there, click Control Panel->System and Computer Name tab. If you are using Windows 7 or Vista, then this information is not available on special tab but is directly displayed in special section on this panel).
You can find here this line (in red box on previous image):
Full Computer Name: XP-HOST.homedomain.hd
and it is FQDN of the computer. If you remove host name from FQDN in Full Computer Name line, you will get the default DNS suffix for your computer. From previous example, the hostname is XP-HOST and default DNS suffix is
To change the hostname, you can click Change (in green box on previous image) and modify the computer name (hostname) in the dialog box.
If you can change the primary DNS suffix then click More on the Computer Name dialogue (the button is in green box on previous image). New dialogue is shown where you can change the default DNS suffix
Adapter (NIC) Related Information
The second and next parts of the ipconfig command output (if you have more than one NIC) are related to each installed and active Network Adapter.
The most important information here is the adapter IP address and Subnet mask.
IP Address. . . . . . . . . . . . : 192.168.1.23 Subnet Mask . . . . . . . . . . . : 255.255.255.0
It specified your LAN IP range and exact IP address of the adapter. All other computers connected to this adapter network will reach the computer by this IP address.
Next line is related to the default gateway
Default Gateway . . . . . . . . . : 192.168.1.1
the IP address where all non LAN traffic will be routed.
You can also determined here, if the adapter has got IP address by DHCP server, or if it is static IP address. This information is available by line:
Dhcp Enabled. . . . . . . . . . . : Yes
When DHCP is enabled, then these two lines:
Lease Obtained. . . . . . . . . . : Saturday, July 03, 2010 3:05:42 PM Lease Expires . . . . . . . . . . : Sunday, July 04, 2010 3:05:42 AM
hold information when the DHCP address has been leased from the DHCP server and when the lease will expire (and new lease will be provided).
Last important information here is DNS server address(es)
DNS Servers . . . . . . . . . . . : 192.168.1.1 192.168.1.100
The computer use this IP(s) to resolve DNS names. Very often you can find here only one record with your home router IP.
On the ipconfig dump you can find also WINS (Windows Internet Name Service) server(s).
Primary WINS Server . . . . . . . : 192.168.1.100 Secondary WINS Server . . . . . . : 192.168.1.110
The WINS is Microsoft implementation of the Name service for NetBIOS traffic. WINS is something similar as DNS for whole internet, but only for NetBIOS computer names. These names are used when you are sharing files or printers by SMB. When DNS is available for the same computer names, it can be used instead of the WINS mechanism (you can use DNS computer names to access shares or printers), but WINS can be used to provide backup or replacement for DNS in local networks. In small home networks, the WINS is not commonly available, because home routers don’t provide support for that. If you can use WINS mechanism, the easiest way to do that is to use Samba server on Linux platform.
Modify Adapter Settings
Sometimes can be useful to change an adapter settings, for example use static IP address instead of DHCP mechanism, or something similar. To do that, we have to go to the Network Connections list dialogue. To do that, we can use many ways from Control Panel, Network Sharing center etc. It has lot of approaches depends on the Windows OS version and configuration. But the easiest way how to do that is to open the Command line and type here this command:
It directly opens the Network Connection list on all common Windows OS versions:
When you will got this list, then select adapter which settings you can modify, then press right mouse button and select Properties.
You will get the next dialogue:
On this dialogue, select the Internet Protocol Version 4 (TCP/IPv4) (on Vista and W7) or Internet Protocol (TCP/IP) (on Xp) item and then press Change (the button is in green box on previous image). Then you will see final dialogue with Adapter IP4 settings:
By choose radio button Obtain IP address automatically (in red box on previous image) you will enable the DHCP IP configuration for selected adapter and all adapter parameters will be obtained automatically from the DHCP server. This is default setting for new Windows installation and is sufficient in most cases.
If you can use Static IP address instead, then select Use the following IP address radio button. Now you can define adapter parameters by hand. To grant fully functional internet connection, you have to specify here default gateway IP address, because it is the gate to other computers outside your LAN. If you are using an Home Router, you can fill here IP of this device (in 99% it is 192.168.1.1 IP address).
You have to define one or more DNS servers here too, if you can use static IP address, because automatic setting doesn’t work here. If you do not fill this value, you will be not able to use DNS names in your WWW browser etc. DNS Server IP is very often same IP as your default gateway value when you are using Home Router. But you can use here any other DNS server IP address which allow to translate DNS names for your public IP address. The good option here can be a Public DNS server, for example provided by Google:
google-public-dns-a.google.com 188.8.131.52 google-public-dns-b.google.com 184.108.40.206
If you do not like use the “Big Brother” services then second alternative from many others can be OpenDNS servers:
resolver1.opendns.com 220.127.116.11 resolver2.opendns.com 18.104.22.168
If you are unsure about your DNS server IP, use one of listed Public DNS servers. It will works always.
Now we know how to change base settings of the adapter. But Windows offers some advanced settings, which can be modified by next advanced dialogue. To open the dialogue, press Advanced button on the Adapter IP4 settings. It is in green box on image above.
Here you can specify more then one IP addresses for the adapter, more Default gateways and prioritize them by metric, specify WINS servers, specify additional DNS server IPs, because you can define more then two DNS server IPs etc.
I can’t describe those options deeply, because it is beyond the scope of this article. If some people will be interested to describe those options deeply, let me know and I’ll write next post about these options.