Linux is not appending domain name in DNS query


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Linux is not appending domain name in DNS query
# 8  
Old 02-11-2020
Hi Neo,
Are you suggesting that I should create short name alias for potentially every name that is absent in DNS ? Note that "ServFail" happens for absent records.
# 9  
Old 02-11-2020
You can either create an entry in /etc/hosts or as a CNAME in your DNS (but in DNS, you must type the domain name, not a single "short name" without the domain name.

Without visibility into your DNS, it's hard to tell what your problem is and if you would post the exact domain name it would be easier to help you debug and so post the FQDN and we can look it up on the Internet.

But, just to give you one example of a real server name on the Internet, like www.unix.com.

Even me, I cannot type www to get to www.unix.com unless I put an entry in my /etc/hosts file.

That is how the Internet works. DNS needs domain names. It is the "DOMAIN NAME SYSTEM".

If you want to use a short word alias, you need to use /etc/hosts. That is how the Internet works.

Code:
a_server# cat /etc/hosts
127.0.0.1   localhost
209.126.104.117 www.unix.com www

If I wanted to type "icecream" and to to this site, I would then have this:

Code:
a_server# cat /etc/hosts
127.0.0.1   localhost
209.126.104.117 www.unix.com icecream www

What am I missing here? This is how it has always worked, as far as I can remember. DNS needs domain names. If you want a short single word alias, you need an /etc/hosts file entry, or so that is how I have always done it.

Like I said, maybe I'm missing something, LOL But this is how I have always done it.... and never had a problem in big and small orgs/networks/domains.
# 10  
Old 02-11-2020
Also, to be clear, I am not saying it is not possible there is another way to do this beside /etc/hosts.

What I am saying is that I have been doing this for many decades (since before the Internet was commercial), and some orgs I have worked as their lead network systems engineer are very huge, and everyone types the FQDN to get to hosts, routers, hubs and switches on network, and when they want or need short one name aliases, we always use /etc/hosts and we have never had a problem, ever.

Maybe I'm just a "simple" kind-of-guy because I like to keep things simple and so they work cleanly and without problems.

If you have 100 servers or 200 and they all need one word "short cuts" to get to a FQDN, just create one file and distribute it to all who need it. That is how we have always done it.

I guess some try the "append it automatically", but frankly, I have seen that method (many years ago) have problems, so that is not how we did it; so I'm telling you want works, for sure. Sometimes keeping things simple works very good Smilie
# 11  
Old 02-11-2020
I think I have failed to articulate the problem. Let me try again.
The client, in the first attempts, append the domainname (as it is in the resolv.conf). If the record is not found then it tries again -- this time it drops the domainname. How do I stop the 2nd attempt or dropping of the domain?

Code:
root@VDIkali:~/DNS_RCA# nslookup  shortname
;; Got SERVFAIL reply from 192.168.1.126, trying next server
;; connection timed out; no servers could be reached

The tcpdump when the above command was run:
Code:
21:33:11.849105 IP 192.168.1.119.45270 > 192.168.1.126.53: 52975+ A? shortname.biman.net. (37)
21:33:11.849581 IP 192.168.1.126.53 > 192.168.1.119.45270: 52975 NXDomain* 0/1/0 (109)
21:33:11.849809 IP 192.168.1.119.50812 > 192.168.1.126.53: 5497+ A? shortname. (27)
21:33:11.850141 IP 192.168.1.126.53 > 192.168.1.119.50812: 5497 ServFail 0/0/0 (27)
21:33:11.850261 IP 192.168.1.119.51672 > 192.168.5.2.53: 5497+ A? shortname. (27)
21:33:16.850422 IP 192.168.1.119.51672 > 192.168.5.2.53: 5497+ A? shortname. (27)

Please observe that the domain name , biman.net has been appended only in the first appempt
# 12  
Old 02-11-2020
AH... OK.. thanks (I feel better now... LOL)

Yes to be clear, I understand how to use the

Code:
search test.com

directive in

Code:
resolve.conf

I just don't use it because it has always given me problems.

SO, back to your issue.

can you ping?

Code:
shortname.biman.com

as wels as ping?

Code:
shortname

(sorry if you discussed this earlier)
# 13  
Old 02-11-2020
biman.net is the domain name. "shortname" does not exist neither as a DNS record , nor as device's name. I am just explaining how DNS client is behaving when query is made for a non-existent record
# 14  
Old 02-11-2020
OK.. sorry I am lost in your posts.

So, you want this output? (of course your names servers will be different)

Code:
ubuntu# nslookup shortname
Server:		69.64.44.20
Address:	69.64.44.20#53

** server can't find shortname: NXDOMAIN

Login or Register to Ask a Question

Previous Thread | Next Thread

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
Login or Register to Ask a Question