Posted: Sat Dec 04, 2021 18:14 Post subject: [SOLVED]How to modify a specific DNS mapping in DD-WRT?
My English is not good, let me give you an example.
For example, if I enter http://www.baidu.com in the address bar of the computer browser, the computer will first query the DNS server and get the corresponding IP address http://220.181.38.251, and then the browser will access this IP address .
What I need now is that when I enter http://www.baidu.com in the browser, DD-WRT will not pass the request to the DNS server, but directly return another IP address (http: //142.251.42.206) to the browser.
How should I operate on the router?
Last edited by zhuli66 on Thu Dec 09, 2021 13:33; edited 1 time in total
-A, --address=/<domain>[/<domain>...]/[<ipaddr>]
Specify an IP address to return for any host in the given domains. Queries in the domains are never forwarded and always replied to with the specified IP address which may be IPv4 or IPv6. To give both IPv4 and IPv6 addresses for a domain, use repeated --address flags. To include multiple IP addresses for a single query, use --addn-hosts=<path> instead. Note that /etc/hosts and DHCP leases override this for individual names. A common use of this is to redirect the entire doubleclick.net domain to some friendly local web server to avoid banner ads. The domain specification works in the same way as for --server, with the additional facility that /#/ matches any domain. Thus --address=/#/1.2.3.4 will always return 1.2.3.4 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver by a more specific --server directive. As for --server, one or more domains with no address returns a no-such-domain answer, so --address=/example.com/ is equivalent to --server=/example.com/ and returns NXDOMAIN for example.com and all its subdomains. An address specified as '#' translates to the NULL address of 0.0.0.0 and its IPv6 equivalent of :: so --address=/example.com/# will return NULL addresses for example.com and its subdomains. This is partly syntactic sugar for --address=/example.com/0.0.0.0 and --address=/example.com/:: but is also more efficient than including both as separate configuration lines. Note that NULL addresses normally work in the same way as localhost, so beware that clients looking up these names are likely to end up talking to themselves.
[quote="kernel-panic69"]Thanks to someone being overzealous, I have to repeat myself.
You need to use address= lines in your additional dnsmasq configs:
Code:
address=/www.baidu.com/142.251.42.206
Hello, I just saw your answer, thank you for your answer.
However, I only bought wrt1900acsv2 a week ago, and I am new to DD-WRT. I really don't understand what you mean by "dnsmasq". Is it a router plug-in? Before using this command line, do I need to install a plug-in to DD-WRT?