# best practices for resolv.conf on dns servers



## pacija (Oct 10, 2012)

What is the best practice for setting resolv.conf on primary and secondary DNS servers responsible (being master and slave) for forward and reverse zones? I have set it to 127.0.0.1 but on reboot I noticed that is certainly not the best solution (sshd takes ages to start among other stuff).

Any advices?


----------



## kpa (Oct 10, 2012)

Replicate the local host names in /etc/hosts so that they are known without the DNS server running.


----------



## Morte (Oct 10, 2012)

pacija said:
			
		

> (sshd takes ages to start among other stuff).


For that specific problem you can set "UseDNS no" in /etc/ssh/sshd_cofig. I usually set it that way, because once DNS goes down there's usually problems I need to fix fast and waiting for sshd makes me more anxious.


----------



## mamalos (Oct 11, 2012)

Apart from /etc/hosts, which is good practice, you can always have one or more secondary DNS servers configured in your /etc/resolv.conf (like your other DNS server as well as your ISP's DNS server).


----------



## pacija (Oct 18, 2012)

Thank you all. I asked this after all kinds of problems that happened after i restarted hypervisor which runs both primary and secondary DNS server, both of whom had the other one as primary, and itself as secondary.

I put servers on separate hypervisors, edited hosts files and sshd_config, and added google's public DNS server as third name server in resolv.conf


----------

