Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 2 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 127.0.0.1 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
add comment

Depending on setup, but as it is Debain I suspect you could add this line to
/etc/dhcp/dhclient.conf:

prepend domain-name-servers 127.0.0.1;

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:

/etc/apache2/ports.conf

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
add comment

Your Answer

 
discard

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.