LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2014, 02:00 AM   #1
adityaj
LQ Newbie
 
Registered: Dec 2013
Posts: 5

Rep: Reputation: Disabled
Question 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.
 
Old 01-09-2014, 03:27 AM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,205

Rep: Reputation: 197Reputation: 197
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..
 
Old 01-09-2014, 04:16 AM   #3
adityaj
LQ Newbie
 
Registered: Dec 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
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)
 
Old 01-09-2014, 10:01 AM   #4
Mani84
LQ Newbie
 
Registered: Dec 2013
Posts: 11
Blog Entries: 1

Rep: Reputation: Disabled
Please share the /etc/hosts file entry
 
Old 01-09-2014, 10:33 AM   #5
adityaj
LQ Newbie
 
Registered: Dec 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
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"
 
Old 01-09-2014, 11:03 AM   #6
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,250
Blog Entries: 11

Rep: Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289Reputation: 2289
try:
Code:
127.0.0.1 localhost.localdomain localhost
127.0.0.1 myserver.PacketCableTesting.net myserver
 
Old 01-10-2014, 12:35 AM   #7
adityaj
LQ Newbie
 
Registered: Dec 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
It gave the same error of SERVFAIL.
 
Old 01-10-2014, 02:02 AM   #8
Mani84
LQ Newbie
 
Registered: Dec 2013
Posts: 11
Blog Entries: 1

Rep: Reputation: Disabled
Thumbs up

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)

Last edited by Mani84; 01-10-2014 at 02:05 AM.
 
Old 01-10-2014, 02:15 AM   #9
Darshan Parab
LQ Newbie
 
Registered: Jan 2014
Posts: 12

Rep: Reputation: Disabled
Quote:
Originally Posted by Mani84 View Post
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...
 
Old 01-10-2014, 02:47 AM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,205

Rep: Reputation: 197Reputation: 197
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
 
Old 01-15-2014, 02:43 AM   #11
adityaj
LQ Newbie
 
Registered: Dec 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind9 Configuration help... Slow DNS and Servfail on Host lookups sfpcservice Linux - Networking 3 06-12-2013 02:18 AM
Strongbolt host xxxx.xxx 2(servfail) inv|s|ble Linux - Networking 2 11-10-2011 01:17 PM
host *****.com not found: 2 (SERVFAIL Error Master900ve Linux - Server 3 02-28-2009 08:38 AM
2(SERVFAIL) error? GraemeK Linux - Networking 7 08-21-2003 11:45 AM
host command error with RedHat 7.2 phr00ta Linux - Networking 5 04-23-2002 08:03 AM


All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration