Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-14-2010, 11:37 AM   #1
LQ Newbie
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
BIND DNS - Add host record

I'm new to using a BIND DNS server. I currently have one set as a master zone on my LAN.

My question is how can I add a record for my local lan that will resolve without typing in the FQDN? For example I want to be able to type "server" instead of ""

Old 10-14-2010, 11:40 AM   #2
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62

That's actually controlled by the client rather than the DNS server through the resolver utility. To setup that behavior you'll need to add `search` to /etc/resolv.conf on the machine you want to do the shortname lookup on.


1 members found this post helpful.
Old 10-14-2010, 11:53 AM   #3
LQ Newbie
Registered: Oct 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply. I was hoping there was something that could be done on the server side. I know it can be done with the MS DNS server, was just hoping there was something similar on Linux.
Old 10-14-2010, 12:01 PM   #4
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
So the MS DNS server actually modifies my queries as a client when I make them? That doesn't inspire a whole lot of confidence in getting back the result I asked for if that is the case. Are you sure it's not something in the DHCP server that tells the network configurator to add the search line to their resolver?


Old 10-14-2010, 01:05 PM   #5
Senior Member
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,148
Blog Entries: 4

Rep: Reputation: 147Reputation: 147

Linux uses /etc/resolv.conf and /etc/hosts files for resolving IP and hostnames.

Now we can edit the /etc/resolv.conf file manually to add DNS ip or if system is configured for obtaining IP address dynamically then entry is made in /etc/resolv.conf by DHCP server.

If we define forward and reverse zone in DNS server for IP and Hostname resolution we can add this DNS server in DHCP server configuration file as given in sample configuration given below:

Sample DHCP file:See BOLD line in configuration file given below:


ddns-update-style interim
ignore client-updates

subnet netmask {

# The range of IP addresses the server
# will issue to DHCP enabled PC clients
# booting up on the network


# Set the amount of time in seconds that
# a client may keep the IP address

default-lease-time 86400;
max-lease-time 86400;

# Set the default gateway to be used by
# the PC clients

option routers;
# Don't forward DHCP requests from this
# NIC interface to any other NIC
# interfaces

option ip-forwarding off;

# Set the broadcast address and subnet mask
# to be used by the DHCP clients

option broadcast-address;
option subnet-mask;

# Set the NTP server to be used by the
# DHCP clients

option ntp-servers;

# Set the DNS server to be used by the
# DHCP clients

option domain-name-servers;

# If you specify a WINS server for your Windows clients,
# you need to include the following option in the dhcpd.conf file:

option netbios-name-servers;

# You can also assign specific IP addresses based on the clients'
# ethernet MAC address as follows (Host's name is "laser-printer":

host laser-printer {
hardware ethernet 08:00:2b:4c:59:23;
# List an unused interface here
subnet netmask {

Last edited by prayag_pjs; 10-14-2010 at 01:07 PM.


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
Bind takes long time to replicate A record change to secondary DNS server tech_contact Linux - Networking 3 10-23-2007 08:14 AM
BIND DNS Default Host movitto Linux - Networking 1 03-19-2006 07:02 PM
Bind DNS record macadam Linux - Networking 4 06-11-2005 09:18 AM
need to add static dns record silvereye Linux - Software 10 12-20-2004 11:49 AM
ADD an auto DNS record ! freelinuxcpp Linux - Software 1 01-25-2004 03:16 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:47 PM.

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