Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 7579  / 3 Years ago, thu, july 15, 2021, 3:57:59

I want to have strong DNS cache server on my local host (server). So I need to change name server to my localhost.




  1. How can I change it?
    byt this config it seems I must don't change it via editor so how can I change it?



    root@asqar# cat /etc/resolv.conf 
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 4.2.2.4
    search asqar.net

  2. I'm using bind9 how can I set the DNS cache, any configure ?



More From » bind

 Answers
4

If you want a DNS cache on your local machine, use dnsmasq, not BIND.



Unless you really need a local iterative nameserver, de-install BIND.



sudo apt-get purge bind9


Now for dnsmasq. There are two ways of using dnsmasq.



1: If you are using NetworkManager to manage networking then you already have the dnsmasq-base package installed; you just have to enable the NetworkManager-controlled dnsmasq instance by editing NetworkManager.conf



sudo gedit /etc/NetworkManager/NetworkManager.conf


and ensuring that the line



dns=dnsmasq


is present. Next enable caching in this dnsmasq instance. Create a new configuration file called, e.g., local



sudo gedit /etc/NetworkManager/dnsmasq.d/local


and add the single line



cache-size=150


to change the default cache size from zero. Then restart network-manager



sudo restart network-manager


which will also start or restart the NetworkManager-controlled dnsmasq instance using the new nonzero cache size.



This only works in Ubuntu 12.10 or later. In Ubuntu 12.04 the NetworkManager-controlled dnsmasq configuration cannot be customized and the cache size is zero.



2: The other way of using dnsmasq is to run it as a server. To do this, install the dnsmasq package and configure it by editing /etc/dnsmasq.conf and setting cache-size to a value greater than zero.



In Ubuntu 12.10 the dnsmasq server will forward queries to external nameservers if the NetworkManager-controlled dnsmasq instance is disabled and will forward queries to the NetworkManager-controlled dnsmasq instance at the address 127.0.1.1 if the NetworkManager-controlled dnsmasq instance is enabled.



In Ubuntu 12.04 the same thing can be achieved but some additional manual configuration steps are required because in Ubuntu 12.04 the NetworkManager-controlled dnsmasq instance listens at 127.0.0.1 which conflicts with dnsmasq server in its default configuration.


[#32329] Friday, July 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ditery

Total Points: 9
Total Questions: 116
Total Answers: 119

Location: Grenada
Member since Sun, Dec 20, 2020
3 Years ago
ditery questions
;