Tuesday, October 14, 2008

Troubleshooting DNS

1. Start Troubleshooting with Ping
Can you ping the target machine?
   a) By IP address. Ping 192.168.1.3
   b) By Hostname. Ping myserver
   c) By fully qualified domain name. Ping myserver.company.com
Examine the replies for clues, for example is the reply myserver or myserver.company.com.
Depending on the results from Ping, check the Default Gateway and Subnet Mask.

2. Do not neglect IPCONFIG
Collect information about default gateways and DNS servers with IPCONFIG’s switches, particularly the /all.
What you are particularly interested in is the DNS Server’s IP address. Should that field be empty or incorrect then adjust the IP address at the Network Icon, TCP/IP properties.
Remember that Ipconfig has 3 DNS specific switches. On more than one occasion /flushdns has saved me tearing my hair out. What happens is that you may have solved the problem, but the a dirty cache prevents confirmation. Ipconfig /registerdns can save a reboot, while /displaydns may give you extra information on what name resolution the client has achieved.

3. Time to look at the DNS server snap-in
At the DNS console, Click on View (Menu) and make sure that Advanced is ticked. This is rather like ‘Show All files’.
Precisely what to look for in the Snap-in, depends on the problem. If you are checking basic connectivity, then check you have a Host (A) record for the machine you are trying to contact. However, I would follow up PING with a check of the Monitor Tab on the DNS Server icon.
For basic Active Directory / DNS configuration check that the _msdcs records were created by DCPROMO. If not try restarting the Netlogon service.
If you have a more difficult problem, for example zone replication, then click on the Server Icon, Properties. (In the diagram Alan is the name of the server.)
One trap is to investigate the DNS server icon when you should be looking at the Forward Lookup Zone, domain name. (Also vica versa, you look at the domain properties instead of the DNS server icon.)
About half the solution to DNS problems require a restart of the DNS service, fortunately Microsoft supply a Restart option on the ‘All Tasks’ menu.

4. NSLookup
My conclusion for troubleshooting with NSLookup is avoid it. Instead, where ever possible, use the above DNS snap-in. At first I was in awe of NSLookup, then I mastered it, then I realized that it did not give me any more information than the DNS snap-in.
So, the killer use of NSLookup is if you do not have the DNS snap-in, for example you are troubleshooting from an XP machine.
The trap with NSLookup is that you forget to configure the PTR records, without the corresponding Reverse Lookup Zone, NSLookup will fail.

5. Hosts files
Reverting to hosts files may seem like taking a step backwards into the dark ages, but many is the time that this trust old technology has solved a problem.
The beauty of the hosts file is its simplicity and the fact that the client operating system reads the hosts file BEFORE it queries DNS. Be sure that you are editing the hosts file in the %systemroot%system32driversetc. (Not in the i386 or dllcache folder)
Once you have opened the hosts file with notepad, experiment with hostnames and IP addresses for the server that you wish to connect. Once you have added the host entry try once more to contact with Ping.
Example of Hosts file entries
192.168.1.3 myserver
or
192.168.1.3 myserver.mycompany.com

6. Event Viewer
In truth the Event Viewer should be the first place to look for clues, not the last! Mastering the Event Viewer is an art in itself. The point to remember is that DNS has its own Log. By all means check the system log or even the application log, but do investigate the DNS log.
What you are looking for depends on the problem area. But here are a few categories to check: Domain Name Problems, Resource Record, Database Load and there really is a DNS Sanity Check!

How To DHCP (All about DHCP)

DHCP Advantage
1) Adding DHCP to the network does not cost anything extra because Free.
2) Once the IP configuration information is entered in the server , it is automatically passed to the clients . Thus a user cannot misconfigure any parameter.
3) Problems that occur ,during configuration are minimized.
4) DHCP assign the IP addresses only when the client makes a request. This leads to the conservation of ip addresses

DHCP Disadvantage
1) Only some of the DHCP client implementations work properly with the DHCP Server in windows server 2003.
2) The information in dhcp server is automatically deliverd to all the dhcp clients .Thus , it become important to put correct information into dhcp server.
3) If there is a single dhcp server and it is not available, lease will not be requested or renewed .this way it will be single point of failure for the network.
4)In oreder to use dhcp on a multisegment network , DHCP server or relay agent should be placed on each segment .you can also ensure that the router is forwarding Bootstrap protocol Broadcasts.

Managing DHCP
Managing DHCP Involves prforming Various functions to ensure smooth running of the DHCP service.
To use the DHCp Console To modify the dhcp Status
1) Select Start> All programs > Admin tools >DHCp.
2) Select the DHCP Server .
3) Select action > all tasks .A drop menu appears .
4) Select the required option.
Alternatively you can use the services console to modify the DHCP Status
1) Select start > All programs > Admin Tools > Services.
2) Double Click Dhcp Server.
3) To modify the Dhcp server status Clickany of the buttons from the service status group .

Summery
1) DHCP Automates the allocation of ip addresses to clients.
2) A DHCP server must be authorizes in active directory before they can assign ip address.
3) A set of one or more ip addresses is called an exclusion range .
4) Multinet is a configuration where more than one logical ip network is used on each physical network or subnet.
5) DHCP clients can be configured to receive ip addresses automatically or manually
6) You can soecify alternative settings for dhcpclients using the altern configuration tab.
7)Atleast period is the length of time for which the DHCp server allocates an ip address to the client.
8) The process to obtain an ip address is called the initial lease process.
9) There are four messages sent during the initial lease process
# DHCP Server
# DHCP Offer
# DHCP Request
# DHCp Ack
10) The deafault lease period for an ip address is 8 days.