Bug 1449814

Summary: nslookup and dig return SERVFAIL error for FQDN after multiple queries
Product: Red Hat Enterprise Linux 6 Reporter: SHAURYA <sshaurya>
Component: bindAssignee: Petr Menšík <pemensik>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: high    
Version: 6.8CC: pemensik, sshaurya, thozza
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1470637 (view as bug list) Environment:
Last Closed: 2017-10-27 14:48:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1461138, 1470637    
Attachments:
Description Flags
Keep origin on new TCP connection patch none

Description SHAURYA 2017-05-10 19:07:21 UTC
Description of problem:

From the captured tcpdump  output below, nslookup initiated the query with the correct FQDN.  It resent the correct FQDN for 3 times.  It decided to drop the domain name on the fourth try.  My question is now why nslookup dropped the domain name after not receiving responses from DNS servers?  Is it a feature and working as designed or is it a bug?  

  16:00:59.995106 IP fdsuv06672.fda.gov.50776 > frs26.fda.gov.domain: 64591+ A? fdsuv06673.fda.gov. (36)
16:01:05.995589 IP fdsuv06672.fda.gov.50776 > frs26.fda.gov.domain: 64591+ A? fdsuv06673.fda.gov. (36)
16:01:11.996147 IP fdsuv06672.fda.gov.50776 > frs26.fda.gov.domain: 64591+ A? fdsuv06673.fda.gov. (36)
16:01:17.997399 IP fdsuv06672.fda.gov.60646 > frs26.fda.gov.domain: 32532+ A? fdsuv06673. (28)
16:01:17.998119 IP frs26.fda.gov.domain > fdsuv06672.fda.gov.60646: 32532 ServFail 0/0/0 (28)
16:01:23.158342 IP fdsuv06672.fda.gov.55490 > frs26.fda.gov.domain: 40253+ A? fdsuv06673.fda.gov. (36)
16:01:23.159069 IP frs26.fda.gov.domain > fdsuv06672.fda.gov.55490: 40253* 1/0/0 A 10.175.170.99 (52)


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

Limit the firewall for maximum nslookup and dig requests.

Actual results:



Expected results:


Additional info:

Comment 2 Petr Menšík 2017-05-17 17:27:04 UTC
Hello SHAURYA.

If target server is unreachable, named will retry more servers if it can. If there is no more servers, it will retry the same again. You can configure a bit longer timeout by option resolver-query-timeout. But it can be only between 10 and 30 seconds. In nslookup it can be changed by set timeout=30.

It is a feature. SERVFAIL is returned when resource is temporarily unavailable. It means resolver was unable to fetch positive nor negative response.

In given tcpdump, client asked 3 times for an address. Server was trying to fetch answer but failed, after timeout returning back servfail to fdsuv06672.fda.gov. If response to queries made by frs26.fda.gov server returned later, server will cache it and respond with positive answer on following queries.

Please do not assign high priority in bugs, where you are not sure if they are bugs at all.

If there is anything wrong with the server, log output of server is required. I would require logs from the server to tell you more. Even more details would be logged by OPTIONS="-d 5" in /etc/sysconfig/named for example.

Can I close this bug?

Comment 7 Petr Menšík 2017-07-12 17:48:11 UTC
Yes, I think there is a bug in dig. And it it not yet fixed even in the latest bind beta. It does happen only in dig +tcp mode.

Easiest way to reproduce it is to use iptables to drop incoming acknowledges.

# iptables -I INPUT -p udp --sport domain -j DROP
# iptables -I INPUT -p tcp --sport domain --tcp-flags ACK,SYN ACK -j DROP

There is hidden -d option of dig that will help very much. It will print debug messages to stderr about what it does use as origin.

dig -d +retry=4 +tcp +domain=example foo

where /etc/resolv.conf would contain

nameserver 127.0.0.1
search example

The first connection will query foo expanded by domain example. After it timeouts, it will try a new connection. New connection is created without the search list however, so only bare name used on following retries. UDP searches are not modified, because they do not use requeue_lookup call (logs "making new TCP request").

Finally I found a place to fix it. Reported as [ISC-Bugs #45547]

Comment 8 Petr Menšík 2017-07-12 17:50:00 UTC
Created attachment 1297140 [details]
Keep origin on new TCP connection patch

Comment 11 Red Hat Bugzilla Rules Engine 2017-10-27 14:48:25 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 12 Tomáš Hozza 2017-10-27 14:51:06 UTC
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:
http://redhat.com/rhel/lifecycle

This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com