How to modify local DNS

Source: Internet
Author: User
Tags nslookup nslookup command

In the process of accessing the Web site, we may often encounter the phenomenon of inaccessible web pages, when encountered this phenomenon, I believe most people will subconsciously think that the network dropped, or the target site of the server there is a problem, but after a careful investigation, the Web page can not open the phenomenon is not caused by these factors, So what is the reason for the Web page content can not open it.

In fact, the most likely cause of the inability to open a Web page when both the network connection and the target server are normal is that the DNS service is unexpectedly causing the Web site address to be parsed, and that the DNS service is not functioning properly. So how can we in the shortest possible time to confirm that the Web page open failure is caused by the DNS service, when the DNS service is not running properly, how do we let the DNS service quickly restore normalcy? Below, this article starts from the phenomenon that the DNS service runs abnormally, judgment and response, To get the DNS service back to normal as soon as possible!

In general, we visit a target site is through the input form such as "www.3lian.com" format of the Web site to complete the mission, this site is actually the domain name of the target site; however, we know that the host and host to each other access, communication, through the IP address to identify each other, confirmed , so we can successfully open the site only if we know the IP address of the target site. However, given that the IP address is not easy to remember, therefore, we almost all in the form of domain name to access the content of the site, the input of the website address is often specified by the DNS server automatically resolved to translate into IP address; the server that can provide DNS service can be either a local computer or a specific computer on the network. However, once the DNS server is not functioning properly, unable to provide address resolution service for users or resolves the domain name to the wrong IP address, we cannot open the page content of the target site through the form of the site domain name. The most obvious phenomenon that the DNS service is not functioning properly is that it is normal to access the IP address of the target Web site, and an error occurs when accessing its domain name.

When the Web page content cannot be opened and you suspect that the DNS service is not functioning properly, the first thing to do is to use the nslookup command that comes with the Windows system to confirm that the local DNS service is not functioning properly. The following are steps to confirm that the DNS service is running correctly:

First in the local workstation system desktop Open the Start menu, and execute the "run" command, from the pop-up System dialog box to enter the string command "cmd", click the "OK" button, the system screen switch to the MS-DOS command line mode of operation;

Second, the input string command "Nslookup-q=ns www.45it.com" in the DOS command line, click the ENTER key if the DNS service is not functioning properly during address resolution, then we will see only "DNS Request timed out" in the result interface. Timeout was 2 seconds "such a hint message.

After confirming that the site content cannot be opened because the address cannot be resolved, the next thing we do is check that the DNS server used by the local workstation is functioning properly, and that the DNS service cannot, of course, provide resolution services for the site's addresses if the DNS server is not functioning properly. When checking that the DNS server itself is functioning properly, we can follow these steps:

First, follow the previous steps to switch the system running state to the MS-DOS command Line window, enter the string command "Ipconfig/all" at the command prompt of the window, click the Enter key, and then open the resulting interface as shown in Figure 2, corresponding to the DNS The information at the servers location is the DNS server address used by the local workstation, for example, where the DNS server address is "61.177.7.1";

Second, according to the IP address to determine whether the DNS server is located in the intranet or extranet, such as the author here designated DNS server located in the extranet, so when we found that the use of this DNS server can not properly resolve the Web site address, you may wish to enter the local workstation TCP/IP property Settings window, Replacing a DNS address with a different DNS server address will solve the problem of not opening the Web page; If the specified DNS server is in the intranet, then the Web address cannot be resolved properly using this DNS server. You can ask the Unit network administrator to check the LAN internal DNS server is running normally, as long as the resolution of the operation of the DNS server failure, the general will be able to successfully resolve the Web page can not open the fault.

When accessing the page content of the target site in the form of a site domain name, the local workstation does not necessarily seek help from the DNS server, as some workstations have previously saved the domain name and IP address of the frequent visits to the local hosts file. So when the local workstation access to a target site's domain name will often automatically check the local Hosts file, if the file contains the target site's domain name and IP address corresponding relationship, then the target site's website address can be successfully resolved. According to the above analysis, we can use the manual method to those who can not open the content of the Web site domain name and IP address to add to the local hosts file, in order to achieve the goal of successfully resolving the target site, The following are the steps to manually add the target site domain name and IP address correspondence to the Hosts file:

First open the Resource Manager window of the local workstation system, expand the X:windowssystem32driversetc folder in the window, and locate the hosts file in the corresponding "etc" subfolder window, and of course we can execute the start/search command in turn , to find the target Hosts file by means of file search;

Second, with Notepad and other text editing programs to open the Hosts file, in the subsequent pop-up file editing window we can see the hosts file all the site domain name and IP address corresponding relationship, in the default state that the file contains only "127.0.0.1 localhost" This line of content, which begins with "#" is not a valid content, but the specific help information;

Next we will be unable to access those site resolution entries manually added to the local Hosts file, the specific add format should be entered the target site domain name corresponding to the IP address, and then enter a space and connect the specific domain name information, such as the author here manually added " 61.129.51.27 www.45it.net "; After the confirmation information is entered correctly, then execute the" file "/" Save "command in the File edit window, and then save the above input according to the original name, so that we can successfully resolve the domain names of the target website into IP address.

When we visited the target site in the form of a domain name, the site's domain name and IP address will automatically be saved to the local workstation's DNS cache list, and later IE will give priority to accessing the information in the DNS cache list, but once the domain name and IP address of the target site are changed, The corresponding resolution records in the DNS cache list do not follow the synchronization changes, so it is easy to fail DNS resolution failure when we visit the target site again in the form of a domain name. At this time, we can refresh the local DNS cache list to resolve the failure of the Web page can not open, the following is the specific steps to refresh the local DNS cache list:

First in the local workstation system desktop Open the Start menu, and execute the "run" command, from the pop-up System dialog box to enter the string command "cmd", click the "OK" button, the system screen switch to the MS-DOS command line mode of operation;

Second, in the DOS command line, the input string command "Ipconfig/flushdns", after clicking the Enter key, we'll see a hint like "successfully flushed the DNS resolver cache" From the result interface shown in Figure 4. This means that the information in the local workstation DNS cache list has been successfully refreshed. After that, we re to visit the target site in the form of domain name, we believe that the content of the page can be opened correctly.

Encountered the DNS service is not normal phenomenon is often the case, in the face of this failure phenomenon we only follow the response provided in this article to make a decision to try, I believe that DNS parsing error will be quickly ruled out.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.