LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-22-2012, 10:01 AM   #1
baby_penguin
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Rep: Reputation: Disabled
Need help setting up dns/dhcp server for use by Linux workstations


Hello Linux word!

I've recently began to cut my teeth on Linux, and let me tell you that I am impressed at how powerful Linux really is! But with so much power, one must invest time in learning to manage such power. After months of learning I still consider myself a novice to the Linux world. So with that said, I've come to request some help from you... *deep breath* I am having trouble setting up an Ubuntu Linux server and I'm hoping that you could help me out with my endeavors. I am trying to setup an intranet server that will also be in charge of all dns/dhcp functions. This server will connect to the Internet via eth1 and serve request via eth0. Once a workstation is connected, it should be able to ping the dhcp server by name, and FQDN (I've setup various subdomains on the server, for example: staff.network.local should be "pingable" as well as servername.network.local and servername). But therein lies the problem. I have setup bind9, dhcp-server & client, apache, and samba. I've setup the bind zones, smb.conf and dhcpd.conf, and strangely enough, I'm able to ping the dhcp server by name from a windows workstation, but not from a linux workstation. I understand that Windows is able to resolve the dhcp hostname because of Samba/WINS, but since I'm migrating to Linux, it makes little difference to me. I would like to be able to access my intranet sites by their server names and their "BIND names". I've spent quite some time trying to get things to work but to no avail. Please help. Thank you
 
Old 06-22-2012, 10:30 AM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
I would help to know how the Linux clients are set up...

Usually you would have to set up the /etc/resolv.conf to have something like

Code:
nameserver <your DNS ip address>
search <DOMAIN NAME>
From what I understand (I don't normally use Ubuntu) you edit this file with the resolvconf command

Although you said that you're suing DHCP...so that information should already be there...

What is the output of the following commands?

Code:
ip addr
ip route
cat /etc/resolv.conf
-C
 
Old 06-22-2012, 12:39 PM   #3
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 765

Rep: Reputation: 172Reputation: 172
Bind?

If what you want is a caching DNS server with integrated DHCP for your entire internal network, BIND and DHCPD are overkill and inconvenient to manage. Pull down DNSMASQ from your repository and configure it on that server. It has a much easier configuration, defines the DNS and DHCP in ONE configuration file that is FAR easier to read. It also makes use of your resolv.conf and hosts files if you do not tell it to avoid that (which makes loading your local static resources VERY simple).

Take a look at it and let me know if you have problems.
 
1 members found this post helpful.
Old 06-22-2012, 05:16 PM   #4
baby_penguin
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by custangro View Post
I would help to know how the Linux clients are set up...

Usually you would have to set up the /etc/resolv.conf to have something like

Code:
nameserver <your DNS ip address>
search <DOMAIN NAME>
From what I understand (I don't normally use Ubuntu) you edit this file with the resolvconf command

Although you said that you're suing DHCP...so that information should already be there...

What is the output of the following commands?

Code:
ip addr
ip route
cat /etc/resolv.conf
-C
The results of ~#ip addr:
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:14:2a:54:93:77 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.4/24 brd 192.168.1.255 scope global eth1
    inet6 fe80::214:2aff:fe54:9377/64 scope link 
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 84:c9:b2:37:a8:c8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global eth0
    inet6 fe80::86c9:b2ff:fe37:a8c8/64 scope link 
       valid_lft forever preferred_lft forever
The results of ~#ip route:
Code:
default via 192.168.1.1 dev eth1  metric 100 
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.1 
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.4
the results of ~#cat /etc/resolv.conf:
Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.1
nameserver 192.168.1.1
search my-domain
How does it look?

Last edited by baby_penguin; 06-22-2012 at 05:28 PM.
 
Old 06-22-2012, 05:20 PM   #5
baby_penguin
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
If what you want is a caching DNS server with integrated DHCP for your entire internal network, BIND and DHCPD are overkill and inconvenient to manage. Pull down DNSMASQ from your repository and configure it on that server. It has a much easier configuration, defines the DNS and DHCP in ONE configuration file that is FAR easier to read. It also makes use of your resolv.conf and hosts files if you do not tell it to avoid that (which makes loading your local static resources VERY simple).

Take a look at it and let me know if you have problems.
Thank you for the suggestion! I will give it a try soon enough, and get back at you once I've setup DNSMASQ. But curious question: What makes the use of BIND and DHCPD overkill for these purposes?
 
Old 06-23-2012, 06:57 AM   #6
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Quote:
Originally Posted by baby_penguin View Post
Thank you for the suggestion! I will give it a try soon enough, and get back at you once I've setup DNSMASQ. But curious question: What makes the use of BIND and DHCPD overkill for these purposes?
Bind is designed to be an authoritative nameserver, meaning it would hold DNS records for domains that you manage and control. It doesn't sound like you're doing that.

Instead, it seems you want DHCP and public DNS for a group of machines on a LAN. dnsmasq provides these capabilities in one lightweight package. Make sure you remove bind and dhcpd before starting dnsmasq.
 
Old 06-23-2012, 07:54 AM   #7
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 765

Rep: Reputation: 172Reputation: 172
Bind and DNSMASQ

BIND is MONDO! powerful and can act as almost any kind or combination nameserver: primary, secondary, caching, tertiary, or mixed, and in combinations of those for multiple domains. You only need a simple one-domain nameserver that caches to speed repeat resolution, speed up your queries, serve your local network domain (only), and integrate DHCP.

DNSMASQ does most of that in the default. In addition to the simple DNS functions it can provide integrated DHCP services within your network. BIND does not do DHCP, and integrating BIND and DHCPD is well documented, but non-trivial for the beginner. DNSMASQ has not the power or versatility of BIND, but is far less complex and still does everything you require.

I say that BIND is overkill (for your case) because it has far more power and options than you need and is much more complex to configure. Make no mistake, the combination of BIND and DHCPD CAN DO ALL YOU WANT! There is real power there. But it might take me more than four hours to get that working, and I could have DNSMASQ configured and running as desired in about 20 minutes, in less memory, using less disk space, and you could read and understand the configuration without researching it for an hour. As a beginner it may take you a day the first time, but less than an hour the second time, it is that easy and quick to learn.

You will need DNSMASQ to pick up your ISP or public DNS servers, and it can pull them for its local resolv.conf file. It can also provide the search domains so that short names resolve properly. You need your client machines configured to load network settings using DHCP, and provide the DHCP server their host name (I believe that this is default, but have not tested all clients). If you pre-load your /etc/hosts file on the DNSMASQ server it should read and pre-load it's tables usign that data.

Just reading through the dnsmasq configuration file and the comments there might give you all of the information you need to set up both server and client properly. Most of the correct behavior you want is the default behavior for DHCP servers and clients.

Last edited by wpeckham; 06-23-2012 at 07:57 AM.
 
1 members found this post helpful.
Old 06-23-2012, 10:29 AM   #8
baby_penguin
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
If what you want is a caching DNS server with integrated DHCP for your entire internal network, BIND and DHCPD are overkill and inconvenient to manage. Pull down DNSMASQ from your repository and configure it on that server. It has a much easier configuration, defines the DNS and DHCP in ONE configuration file that is FAR easier to read. It also makes use of your resolv.conf and hosts files if you do not tell it to avoid that (which makes loading your local static resources VERY simple).

Take a look at it and let me know if you have problems.
Dude where were you when I was pulling out hairs on my now bald head??? You're a lifesaver! Thanks.
 
Old 06-24-2012, 12:32 PM   #9
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 765

Rep: Reputation: 172Reputation: 172
well

If you could see past the glare reflecting from the surface that was once home to MY head of hair, you could tell that I have been there. A LOT!
 
Old 07-01-2012, 09:30 PM   #10
baby_penguin
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
If you could see past the glare reflecting from the surface that was once home to MY head of hair, you could tell that I have been there. A LOT!
Does that mean I'm just being initiated?
 
  


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
dhcp client .. not setting gateway and dns server scabrous1 Linux - Networking 1 05-09-2006 10:31 AM
Help in setting up Gateway, DHCP and DNS Server depam Linux - Software 1 10-06-2005 11:52 AM
server runs redhat , workstations win 2k ,workstations cannot connect to internet snkambule Linux - Networking 7 04-27-2005 10:08 AM
trying to set up a dhcp server to boot diskless workstations scottsteibel Linux - Networking 1 08-17-2004 05:13 PM


All times are GMT -5. The time now is 01:42 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration