LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-26-2020, 12:01 PM   #1
almontef
LQ Newbie
 
Registered: Feb 2020
Posts: 1

Rep: Reputation: Disabled
New DNS server: help needed with resolving short hostnames


Hi Forum!

I just setup a BIND/NAMED DNS server on RHEL 7 for internal use.

I am able to resolve the full FQDN and IP address, but if I try and just resolve the hostname by itself, I get

server can't find <hostname>: NXDOMAIN

Domain: guardium.dev
DNS Server: 192.168.42.2 Hostname: dns
Server 1: 192.168.42.10 Hostname: manager
Server 2: 192.168.42.11 Hostname: collector
Server 3: 192.168.42.20 Hostname: gimaster
Server 4: 192.168.42.21 Hostname: gidata
Server 5: 192.168.42.22 Hostname: giaux1
Server 6: 192.168.42.23 Hostname: giaux2

Here is my setup (can only take screen grabs sorry):

named.conf
https://hosting.photobucket.com/imag...amed.conf1.png
http://https://hosting.photobucket.c...amed.conf2.png

Forward zone file:
https://hosting.photobucket.com/imag...orwardzone.png

Reverse zone file:
https://hosting.photobucket.com/imag...eversezone.png

nslookup test from one of the servers showing that IP and FQDN can be resolved, but not the host name:
http://https://hosting.photobucket.c...0/nslookup.png

Any guidance into what I may be doing wrong would be greatly appreciated. Thanks in advance.
 
Old 02-26-2020, 05:21 PM   #2
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by almontef View Post
server can't find <hostname>: NXDOMAIN
I always use a "search <some domains>" statement in my /etc/resolv.conf (on the client machines), so that an UNqualified hostname will be searched for in multiple domains.
I.e.
search "my local domain" "my DNS servers domain" "my providers domain"
 
Old 03-06-2020, 01:24 PM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,820

Rep: Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212
Yes, you need a search line in /etc/resolv.conf
Further ensure there is dns in the hosts: line in /etc/nsswitch.conf, best after files.
 
  


Reply



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
DNS resolving IP but not resolving hostnames; ping unknown host google.com mattlyons Linux - Networking 15 02-26-2017 04:01 AM
DNS not working with short hostnames tiuz Linux - Server 4 07-24-2010 05:05 PM
Named DNS Server Not Resolving Domain Short Names jviera Linux - Server 2 06-01-2009 04:33 PM
DNS not resolving internet hostnames KeenAs Linux - Networking 9 02-05-2009 03:20 AM
My Server.... resolving hostnames! SyncMaster Linux - Networking 2 06-25-2005 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:45 AM.

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
Open Source Consulting | Domain Registration