LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SERVFAIL error on host command (https://www.linuxquestions.org/questions/linux-newbie-8/servfail-error-on-host-command-4175490648/)

adityaj 01-09-2014 02:00 AM

SERVFAIL error on host command
 
Hi All,

My linux server was working perfectly till yesterday. And now I am at a complete loss to what happened. Consider me a newbie. I only configured it 3 days back.

my "hostname" command returns "myserver.PacketCableTesting.net"
This is perfect.

But when I run "host myserver.PacketCableTesting.net", I get:
"Host myserver.PacketCableTesting.net not found: 2(SERVFAIL)"

Yet, when I run "ping myserver.PacketCableTesting.net", the pings work perfectly with 0% loss, because the DNS server is running on my machine itself.

What is happening? Please help.

JJJCR 01-09-2014 03:27 AM

on your /etc/resolv.conf is there 127.0.0.1 ip add?

did you register a public domain for packetcabletesting.net?

or try host packetcabletesting.net (don't include myserver) check how it goes..

adityaj 01-09-2014 04:16 AM

This is the content of file /etc/resolv.conf:
"#sudo cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search
#"

Running command "host packetcabletesting.net" also gives same result: "Host PacketCableTesting.net not found: 2(SERVFAIL)"

I have created my local domain PacketCableTesting.net. It is not connected to the internet. My requirement is only to get myserver.PacketCableTesting.net resolved by my requesting client machine, which is also in the private network.
I am using CNR server for running DNS srver. I have added a root nameserver myserver.PacketCableTesting.net with an IP 192.168.221.231. (Snapshot attached)

Mani84 01-09-2014 10:01 AM

Please share the /etc/hosts file entry

adityaj 01-09-2014 10:33 AM

This is the content of /etc/hosts file:
"# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.221.231 myserver.PacketCableTesting.net myserver"

192.168.221.231 is the IP of this machine itself on which I am working and reporting the issue. So everything is local on this machine.
And I tried command "host localhost", that runs fine. It returns "localhost has address 127.0.0.1"

Habitual 01-09-2014 11:03 AM

try:
Code:

127.0.0.1 localhost.localdomain localhost
127.0.0.1 myserver.PacketCableTesting.net myserver


adityaj 01-10-2014 12:35 AM

It gave the same error of SERVFAIL. :(

Mani84 01-10-2014 02:02 AM

host command uses DNS for name resolving,not the hosts file.But ping uses both (DNS & hosts file)
Code:


Try adding the following lines in the /etc/resolv.conf
search PacketCableTesting.net
nameserver 192.168.221.231

Since you have mentioned DNS service is running on local box (192.168.221.231)

Darshan Parab 01-10-2014 02:15 AM

Quote:

Originally Posted by Mani84 (Post 5095328)
host command uses DNS for name resolving,not the hosts file.But ping uses both (DNS & hosts file)
Code:


Try adding the following lines in the /etc/resolv.conf
search PacketCableTesting.net
nameserver 192.168.221.231

Since you have mentioned DNS service is running on local box (192.168.221.231)

Yes. This seems correct. DNS server is running but not configured. This seems a solution...

JJJCR 01-10-2014 02:47 AM

check out this link it might help: http://my-wd-local.wikidot.com/confi...-linux-clients

try:
Quote:

127.0.0.1 localhost.localdomain
127.0.0.1 myserver.PacketCableTesting.net

adityaj 01-15-2014 02:43 AM

I'm so sorry for not able to reply. I was bed-ridden.
Making changes to linux server was driving my 12 member team crazy. So, I searched for a fake DNS server on the net, as I only needed to get a dummy hostname resolved. I found two pretty nice fake dns servers at:
http://sourceforge.net/projects/dnspentest/ and
http://www.speedys.cc/Linux-Network/...rk/447702.html

Both are simple to use. The java program (dnspentest) is said to be more stable. I've tried both.

Thanks guys for all the help. It increases my understanding of the subject. And if I get the bandwidth I will surely report on your given guidance too.


All times are GMT -5. The time now is 06:40 AM.