LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
BIND DNS - Add host record


Hi,
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 "server.domain.com"

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

Rep: Reputation: 62
Hello,

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 domain.com` to /etc/resolv.conf on the machine you want to do the shortname lookup on.

Regards,

Alunduil
 
1 members found this post helpful.
Old 10-14-2010, 11:53 AM   #3
gen2_user
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
alunduil
Member
 
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?

Regards,

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

Rep: Reputation: 147Reputation: 147
Hi,

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:

/etc/dhcpd.conf

Quote:
ddns-update-style interim
ignore client-updates

subnet 192.168.1.0 netmask 255.255.255.0 {

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

range 192.168.1.201 192.168.1.220;

# 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 192.168.1.1;
# 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 192.168.1.255;
option subnet-mask 255.255.255.0;

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

option ntp-servers 192.168.1.100;

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

option domain-name-servers 192.168.1.100;

# 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 192.168.1.100;

# 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;
fixed-address 192.168.1.222;
}
}
#
# List an unused interface here
#
subnet 192.168.2.0 netmask 255.255.255.0 {
}

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


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration