Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
What Unix variant or Linux distribution are you using? – Gilles May 29 '13 at 9:29
up vote 3 down vote accepted

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

share|improve this answer
Do you mean adding nameserver to it? – al-Amjad Tawfiq Isstaif May 28 '13 at 17:14
Thank you! It worked! – al-Amjad Tawfiq Isstaif May 28 '13 at 17:40

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.

share|improve this answer
Thank you so much for you detailed answer. I couldn't vote it up since I don't have enough reputation yet :( – al-Amjad Tawfiq Isstaif May 28 '13 at 17:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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