I've set up a local domain name by creating a zone (by following the steps in this tutorial).

Why I look the domain using dig, I get the right results when using the following command:

dig debian.lan @localhost

But when I don't add the DNS address, it doesn't return an answer. How can I solve this problem?

dig debian.lan

You need to configure the nameserver in /etc/resolv.conf or whichever tool generates this file.


Depending on setup, but as it is Debain I suspect you could add this line to

prepend domain-name-servers;

depending on your system /etc/resolv.conf most likely get overwritten.

Then restart ethX interface.

If you want to use ifdown and ifup you might also have to add this to your
/etc/network/interfaces (e.g. for eth1):

auto eth1
iface eth1 inet dhcp

Then first time reload:

sudo nohup sh -c "ifdown eth1 && ifup eth1"

If you are combining it with Apache add:

ServerName localhost



to prevent "apache2: Could not reliably determine the server's fully qualified domain name, …" in your logs.

  • Thank you so much for you detailed answer. I couldn't vote it up since I don't have enough reputation yet :( May 28 '13 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.