Configure DNS server for get IP from DHCP.
Configure DNS server for get IP from DHCP.
Hello.
I want to configure my Linux DNS server in CentOS 7, I found below tutorial :
http://www.unixmen.com/setting-dns-server-centos-7/
but in this tutorial, Client have specific IP address and name but I don't know my clients IP and computer name because my clients take IP from DHCP server.
How can I configure my DNS server for DHCP?
Thank you.
I want to configure my Linux DNS server in CentOS 7, I found below tutorial :
http://www.unixmen.com/setting-dns-server-centos-7/
but in this tutorial, Client have specific IP address and name but I don't know my clients IP and computer name because my clients take IP from DHCP server.
How can I configure my DNS server for DHCP?
Thank you.
Re: Configure DNS server for get IP from DHCP.
I found below tutorial too :
http://www.server-world.info/en/note?os=CentOS_7&p=dns
but I got error :
# systemctl restart named
Job for named.service failed. See 'systemctl status named.service' and 'journalctl -xn' for details.
[root@localhost mohsen]# systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; disabled)
Active: failed (Result: exit-code) since Sun 2015-08-30 07:05:20 EDT; 2min 34s ago
Process: 4010 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=1/FAILURE)
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone 0.in-addr.arpa/IN: loaded serial 0
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone linux.dj/IN: loading from master file l...nd
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone linux.dj/IN: not loaded due to errors.
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: external/linux.dj/IN: file not found
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone 80.0.16.172.in-addr.arpa/IN: loading fr...nd
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone 80.0.16.172.in-addr.arpa/IN: not loaded...s.
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: external/80.0.16.172.in-addr.arpa/IN: file n...nd
Aug 30 07:05:20 localhost.localdomain systemd[1]: named.service: control process exited, code=exited status=1
Aug 30 07:05:20 localhost.localdomain systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Aug 30 07:05:20 localhost.localdomain systemd[1]: Unit named.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
http://www.server-world.info/en/note?os=CentOS_7&p=dns
but I got error :
# systemctl restart named
Job for named.service failed. See 'systemctl status named.service' and 'journalctl -xn' for details.
[root@localhost mohsen]# systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; disabled)
Active: failed (Result: exit-code) since Sun 2015-08-30 07:05:20 EDT; 2min 34s ago
Process: 4010 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=1/FAILURE)
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone 0.in-addr.arpa/IN: loaded serial 0
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone linux.dj/IN: loading from master file l...nd
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone linux.dj/IN: not loaded due to errors.
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: external/linux.dj/IN: file not found
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone 80.0.16.172.in-addr.arpa/IN: loading fr...nd
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: zone 80.0.16.172.in-addr.arpa/IN: not loaded...s.
Aug 30 07:05:20 localhost.localdomain named-checkconf[4010]: external/80.0.16.172.in-addr.arpa/IN: file n...nd
Aug 30 07:05:20 localhost.localdomain systemd[1]: named.service: control process exited, code=exited status=1
Aug 30 07:05:20 localhost.localdomain systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Aug 30 07:05:20 localhost.localdomain systemd[1]: Unit named.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
Re: Configure DNS server for get IP from DHCP.
My config is :
Code: Select all
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.72.1; };
# listen-on-v6 port 53 { none; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 192.168.72.0/24; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view "internal" {
match-clients {
localhost;
192.168.72.0/24;
};
zone "." IN {
type hint;
file "named.ca";
};
zone "linux.dj" IN {
type master;
file "linux.dj.lan";
allow-update { none; };
};
zone "0.0.10.in-addr.arpa" IN {
type master;
file "0.0.10.db";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};
view "external" {
match-clients { any; };
allow-query { any; };
recursion no;
zone "linux.dj" IN {
type master;
file "linux.dj.wan";
allow-update { none; };
};
zone "80.0.16.172.in-addr.arpa" IN {
type master;
file "80.0.16.172.db";
allow-update { none; };
};
};
-
- Posts: 1521
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: Configure DNS server for get IP from DHCP.
Not what you actually asked for, but how about configuring your DHCP server to assign reserved addresses to machines that often connect to your network? This makes them appear 'static' on your network, but acquire addresses correctly elsewhere.
Re: Configure DNS server for get IP from DHCP.
No special configuration should be needed. Or perhaps you want your DNS server to dynamically update the "DNS zone" with the names of the DHCP clients in the LAN, as they come and go?hack3rcon wrote:How can I configure my DNS server for DHCP?
Re: Configure DNS server for get IP from DHCP.
I just want to configure a DNS server for local network. Something like Windows DNS server. Can I specific "Internal" and "External" part? I don't know why I must have "Internal" or "External" ?
Re: Configure DNS server for get IP from DHCP.
If you want the DNS server for your internal LAN to behave like the Windows DNS service does in an Active Directory environment, then I understand that you want is "DNS dynamic updates", and for that you should research how to integrate the DNS service with the DHCP service.hack3rcon wrote:I just want to configure a DNS server for local network. Something like Windows DNS server. Can I specific "Internal" and "External" part? I don't know why I must have "Internal" or "External" ?
Re: Configure DNS server for get IP from DHCP.
Thank you and It is my problem.
I can't find a good tutorial
most of tutorials configure DNS for web server and they have Zone and...
I want to know must I define Internal or External?
I can't find a good tutorial
most of tutorials configure DNS for web server and they have Zone and...
I want to know must I define Internal or External?
Re: Configure DNS server for get IP from DHCP.
You only need an external view if you aim to expose your DNS server to external clients (i.e ones that are not part of your LAN)
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Configure DNS server for get IP from DHCP.
Can you write this configuration for me?
If my local network ip range is "192.168.72.0-255" and other eternal network that I connected to them is "192.167.1.0.-255", Which part of DNS configuration must be changed?
Thank you.
If my local network ip range is "192.168.72.0-255" and other eternal network that I connected to them is "192.167.1.0.-255", Which part of DNS configuration must be changed?
Thank you.