Linux is not appending domain name in DNS query


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Linux is not appending domain name in DNS query
# 1  
Linux is not appending domain name in DNS query

In my /etc/resolv.conf file there is domain name defined. But when I do nslookup the domain name is not appended. Why?

Last edited by rbatte1; 02-10-2020 at 01:59 PM..
# 2  
Hi,
Quote:
In my /etc/resolv.conf file there is domain name defined
Can you be more explicit?
Quote:
when I do nslookup the domain name
How?

Last edited by rbatte1; 02-10-2020 at 01:59 PM..
# 3  
Code:
cat /etc/resolv.conf 
options timeout 2
options attempts 2
nameserver 192.168.1.126
nameserver 192.168.1.12

Note that I have kept 2nd server down

Query and response without FQDN:
Code:
nslookup -q=A AtypeQuery
;; Got SERVFAIL reply from 192.168.1.126, trying next server
;; connection timed out; no servers could be reached

Query and response with FQDN
Code:
nslookup -q=A AtypeQuery.biman.net
Server:		192.168.1.126
Address:	192.168.1.126#53

** server can't find AtypeQuery.biman.net: NXDOMAIN

Note that non-FQDN elicits "ServFail" response
# 4  
I think it is adding (at least now) the domain name. But that is not improving the result.
See below the DNS server returns "ServFail" eventually.

Code:
command : nslookup shortname
TCPDUMP: 
21:57:38.002691 IP 192.168.1.119.55378 > 192.168.1.126.53: 11322+ A? shortname.biman.net. (37)
21:57:38.003080 IP 192.168.1.126.53 > 192.168.1.119.55378: 11322 NXDomain* 0/1/0 (109)
21:57:38.003301 IP 192.168.1.119.48757 > 192.168.1.126.53: 14424+ A? shortname. (27)
21:57:38.003648 IP 192.168.1.126.53 > 192.168.1.119.48757: 14424 ServFail 0/0/0 (27)

But when I feed the FQDN name in command line it works fine

Command: nslookup FQDN.biman.net
Output:
Code:
22:00:46.121081 IP 192.168.1.119.39563 > 192.168.1.126.53: 625+ A? FQDN.biman.net. (32)
22:00:46.121716 IP 192.168.1.126.53 > 192.168.1.119.39563: 625 NXDomain* 0/1/0 (104)

Note that the neither host, FQDN , short exists. I would expect "NXDomain" as opposed to "ServFail" in the first case too.
# 5  
You probably need to add a search record in your resolv.conf file. The manual page has the appropriate syntax. You can add multiple suffixes if you need to. Do you have a selection you would want to loop through?

I hope that this helps. Give it a try and let us know if you are still stuck.



Kind regards,
Robin
# 6  
Hi Robin, I think I missed something when I posted the question. When query is made for short name, client does append the domainname (bimna.net) first time. When DNS server returns with NXDomain then client drops the domain name, and tries again. This is when the DNS server results "ServFail" and delays.

So my rephrased question is: Is there any way to instruct the client not to drop the domainname ? Windows client does not drop it.
Code:
cat /etc/resolv.conf 
search  biman.net 
nameserver 192.168.1.126
nameserver 192.168.5.2  (DOWN)
	

root@VDIkali:~/DNS_RCA# nslookup shortnname_wo_explicit_type
;; Got SERVFAIL reply from 192.168.1.126, trying next server
;; connection timed out; no servers could be reached
 TCPDUMP:
06:25:36.137108 IP 192.168.1.119.43377 > 192.168.1.126.53: 12245+ A? shortnname_wo_explicit_type.biman.net. (55) (The domain is appended in the first try)
06:25:36.137583 IP 192.168.1.126.53 > 192.168.1.119.43377: 12245 NXDomain* 0/1/0 (127)
06:25:36.137879 IP 192.168.1.119.38507 > 192.168.1.126.53: 31605+ A? shortnname_wo_explicit_type. (45) (The domain is dropped in the 2nd try)

06:25:36.138216 IP 192.168.1.126.53 > 192.168.1.119.38507: 31605 ServFail 0/0/0 (45)
06:25:36.138427 IP 192.168.1.119.58620 > 192.168.5.2.53: 31605+ A? shortnname_wo_explicit_type. (45)
06:25:41.138473 IP 192.168.1.119.58620 > 192.168.5.2.53: 31605+ A? shortnname_wo_explicit_type. (45)
06:25:46.139362 IP 192.168.1.119.58620 > 192.168.5.2.53: 31605+ A? shortnname_wo_explicit_type. (45)

# 7  
You might consider adding the "short name alias" in your /etc/hosts file.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #850
Difficulty: Medium
Every Bluetooth device has a unique 48-bit address.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Changing hosting company for one domain, how to deal with DNS?

Hello, Our organization is planning to move one domain from Dreamhost to Hubspot. Lets say, it is gem.xyxyxyxyx.com. Please note, website is not being migrated from one server to another, it is just hosting company. Here is from our internal DNS master server - # cat... (6 Replies)
Discussion started by: solaris_1977
6 Replies

2. Shell Programming and Scripting

Shell script appending output of sql query

I am writing the following script to create the file v_out.txt. sqlplus -s /nolog << EOF CONNECT scott/tiger@orcl; whenever sqlerror exit sql.sqlcode; set newpage 0; SET PAGESIZE 0; SET ECHO OFF; SET FEEDBACK OFF; SET HEADING OFF; SET VERIFY OFF; SET LINESIZE 100; set tab off; set... (7 Replies)
Discussion started by: itzkashi
7 Replies

3. Linux

Domain registrars & DNS servers

I have read many tutorials on bind and i understand the A,MX, CNAME records. Internally, on a LAN we can install bind and create all these records and we can tell all PC and servers to use this bind as DNS server.that's fine. On the Internet, when we have purchased a valid domain like... (5 Replies)
Discussion started by: coolatt
5 Replies

4. Shell Programming and Scripting

Command to flush specific domain in SunOS 5 DNS

Hello to all, May you help saying me how to flush a specific domain in Linux SunOS5 I know the command rndc is to flush DNS cache, but I would like to know: 1- How to do a flush only on specific domain 2- How to see the content of DNS Resolver cache (similar to info given by IPCONFIG... (2 Replies)
Discussion started by: Ophiuchus
2 Replies

5. UNIX for Advanced & Expert Users

DNS server choice: Windows DNS vs Linux BIND

I'd like to get some opnions on choosing DNS server: Windows DNS vs Linux BIND comparrsion: 1) managment, easy of use 2) Security 3) features 4) peformance 5) ?? I personally prefer Windows DNS server for management, it supports GUI and command line. But I am not sure about security... (2 Replies)
Discussion started by: honglus
2 Replies

6. Linux

Configuring dns in local domain

Hi everybody, for revolving local host name of my network, I set up an dns server to solve my problem, but til now, nothing happen when I ping a hostname, but work on IP. Can you help me to correct the configuration. Here is all my settings: Voici mes fichiers de configuration: -... (2 Replies)
Discussion started by: beloge2002
2 Replies

7. IP Networking

Select DNS Servers depending on the domain

Hello, I'm using CentOS 5.3, and I connect to a VPN in order to work. The problem is that I'm constantly accessing things on the local network and the remote network. But once I'm connected to the VPN I can't access local addresses by name, I have to use the ip-address. What I'd like is to... (4 Replies)
Discussion started by: martincastell
4 Replies

8. Windows & DOS: Issues & Discussions

How to: Linux BOX in Windows Domain (w/out joining the domain)

Dear Expert, i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant. ... (2 Replies)
Discussion started by: regmaster
2 Replies

9. Solaris

change dns (domain name)

hi gurus, need to check other than the hosts file, what else i need to change after we have changed the domain name in our company. currently, we are using olddnsname.com and will change it to newdnsname.com. i am not sure where else in solaris i need to take a look. please advise. thank... (4 Replies)
Discussion started by: kim_custodio
4 Replies

Featured Tech Videos