How to quickly build a local DNS server

Source: Internet
Author: User
Tags to domain

DNS can complete the resolution of the Domain Name service, is a tour of the network "traffic Arteries", so many network operators take the opportunity to implant ads in order to win private interests, many users have to switch to a third-party DNS server. But now third-party DNS services are often affected by a variety of interference, so how to solve it?

Setting parameters for a self-built DNS server

The easiest way to solve the above problem is to build a DNS server on the local computer system, but it is very difficult for ordinary users, we may use some tool software to complete, such as dnsagent (download address: TINYURL.COM/NSSYJVC, need Microsoft. NET Framework 4.5 support).

Download the software and unzip it, open the Options.cfg file with a text editor, and you can see that the tool defaults to Google's DNS server (Figure 1). You can modify your own common DNS servers as needed, such as 114DNS (114.114.114.114), Ali DNS (223.5.5.5), OpenDNS (208.67.222.222), and so on. After the modification is complete, save the configuration file, then run the DNSAgent.exe file in the folder, and the tool starts working in the system background (Figure 2).

Small tip:

★ Because Dnsagent uses the DNS compression pointer technology, not all DNS servers support this technology.

★ Because the dnsagent needs to run to be able to parse the service, so the user can run the Install.bat file in the folder. This will add a boot service to the system so that Dnsagent starts running automatically when the system is running. If you do not need to use this tool again, you can also run the Uninstall.bat file to remove the corresponding boot service.

DNS Service transferred to local

Next, open Windows Control Panel, click the "View network status and Tasks" command under Network and Internet, click the "Change adapter Settings" command on the left in the pop-up dialog box, and then open the System's Network Connections window. If the user is surfing through the router, select the "Ethernet" item in the list. If the user is still using a traditional dial-up approach, select the Dial-up connection in the list.

When you have selected your own network connection, right-click it, select Properties, and select the Internet Protocol version 4 entry in the pop-up window list. Click the "Properties" button below and set it to 127.0.0.1 in the "Preferred DNS server" option in the pop-up window (Figure 3). All future domain resolution requests issued by the system will be processed by the tool and sent to the set DNS server for processing. The tool then stores the DNS server's parsing data on the local system so that when the user accesses the same site domain name next time, no more resolution requests are sent to the DNS server, and the parsing information stored in the local system is directly invoked. This avoids the possibility of interference with DNS information.

Efficiency, custom resolution services for different Web sites

In addition to domain name resolution, Dnsagent also has a lot of more practical network functions. For a different site domain name, you can use a different DNS server for resolution, foreign site domain name using Google DNS, the domestic site domain name use 114DNS. But if you want to use this function, you need to write the appropriate rules to do. Now open the Rules.cfg file in dnsagent with a text editor and write a few lines of code in the following format.

{

"Pattern": "^ (. *\.)?" Baidu\.com$ ",

"NameServer": "114.114.114.114"

},

This line of code means that when accessing the domain name containing baidu.com information, use 114.114.114.114 DNS server for domain resolution. Although this rule uses regular expressions, it is also possible to do so with gourd-drawn scoops. But for ordinary users or more cumbersome, so below we use the Web site rules made by netizens, after conversion can be used for me.

First through the browser to access TINYURL.COM/MAC5GH4, in the list to find accelerated-domains.china.conf and click on it, in the pop-up page can see the Web site rules made by netizens (Figure 4).

Now click on the "Raw" button to open a Web page, and then click the right mouse button to select the "All" command in the menu, all the site rules are copied, and then access to Tinyurl.com/m6cnymo in the browser, the list of sites just copied down to the left of the list, Then click on the "Convert" button in the upper left corner and you can see the converted site rules in the right-hand list. Click the "Select Results" button in the upper-right corner to automatically select the rules for conversion completion (Figure 5).

Next, click the right mouse button to copy and paste it into a text editor, and then delete the "[" and "end"] symbols at the beginning. Finally, you can paste these edited rules into the last "]" symbol of the Rules.cfg file (Figure 6).

Small tip:

Because the rule uses the 114.114.114.114 DNS server by default, users can also bulk replace them with other DNS server addresses as needed.

More convenient to replace hosts

Windows system hosts not only can be directly to the domain name resolution, but also can play the role of filtering ads, but now want to modify the system of hosts file, the first need to obtain the system administrator rights can be, the operation of some cumbersome. And now the Dnsagent tool can replace the hosts file with similar functions, so as to reduce the access to the system and other operations, and a domain name before the need to write a rule, dnsagent can be a rule to replace the hosts file in more than one rule, Thus reducing the hassle of a large number of rule entries.

Amazon, for example, now many users like to go to the Amazon's U.S. station for the Sea Amoy, we can modify the information in the hosts, so that it directly connected to the Amazon's U.S. servers rather than the Chinese server, so as to prevent us from switching between different sites. First right click "Start", click "Command Prompt (Admin)" To start it, enter "Ping www.amazon.com" in which and press ENTER, you can get the server's corresponding IP address. Then use a text editor to open the Rules.cfg file in Dnsagent, enter the following code and save it. This code indicates that as long as the domain name includes the http://www.amazon.com/link, the server IP address is directly connected to 205.251.242.103] (Figure 7).

{

"Pattern": "www\.amazon\.com$",

"Address": "205.251.242.103]"

}

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.