Help On Rndc. Want To Control Remote Bind Server, But Cant....

Hi All,

Please help me. I'm following the book - ' DNS and BIND, 5th Ed By Paul Albitz, Cricket Liu '. This RNDC is driving me crazy. I spent all day trying to configure rndc. Tried every possible combination in config files, but I just cant control remote server. Tried many tutorials from google, nothing helped. LQ is my last hope.

So, my story goes like this...

MASTER BIND SERVER:
Host: toystory.movie.edu
IP: 10.249.249.3/24
OS: CentOS 7.1

SLAVE BIND SERVER:
Host: wormhole.movie.edu
IP: 10.249.249.2/24
OS: CentOS 6.6

MASTER SERVER (toystory) CONFIGURATION FILES:
Code:
[root@toystory ~]# cat /etc/rndc.conf
key "toystory-key" {
	algorithm hmac-md5;
	secret "K9qBsQwusP6430cykS2AeA==";
};
options {
	default-key "toystory-key";
	default-server 127.0.0.1;
	default-port 953;
};

[root@toystory ~]# cat /etc/named.conf
key "toystory-key" {
	algorithm hmac-md5;
	secret "K9qBsQwusP6430cykS2AeA==";
};
controls {
	inet 127.0.0.1 port 953
		allow { 127.0.0.1; } keys { "toystory-key"; };
};
key "wormhole-key" {
	algorithm hmac-md5;
	secret "7PvoY3oysQz8DyASiUTlNA==";
};
controls {
	inet 10.249.249.3 port 953
		allow { 10.249.249.2; } keys { "wormhole-key"; };
};

SLAVE SERVER (wormhole) CONFIGURATION FILES:
Code:
[root@wormhole ~]# cat /etc/rndc.conf
key "wormhole-key" {
	algorithm hmac-md5;
	secret "7PvoY3oysQz8DyASiUTlNA==";
};
options {
	default-key "wormhole-key";
	default-server 127.0.0.1;
	default-port 953;
};

[root@wormhole ~]# cat /etc/named.conf
key "wormhole-key" {
	algorithm hmac-md5;
	secret "7PvoY3oysQz8DyASiUTlNA==";
};
controls {
	inet 127.0.0.1 port 953
		allow { 127.0.0.1; } keys { "wormhole-key"; };
};
server 10.249.249.3 {
  keys { "wormhole-key"; };
};

TESTING:

MASTER (toystory):
Code:
[root@toystory ~]# rndc status
version: 9.9.4-RedHat-9.9.4-18.el7_1.1 <id:8f9657aa>
CPUs found: 1
worker threads: 1
UDP listeners per interface: 1
number of zones: 104
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running

[root@toystory ~]# rndc -s wormhole.movie.edu status
rndc: connect failed: 10.249.249.2#953: connection refused

SLAVE (wormhole):
Code:
[root@wormhole ~]# rndc status
version: 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.2
CPUs found: 1
worker threads: 1
number of zones: 22
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running

What I'm doing wrong? Please Help!!!

Thanks


Similar Content



Please Help Me To Start My DNS Server Logging.

I am facing problem in enabling the DNS Log making in named.conf file.
My /etc/named.conf file structure is as follows:
-------------------------------------------------------------
//
// 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; 10.40.124.2; };
listen-on-v6 port 53 { ::1; };
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; 10.40.124.2; };
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";
};

logging {
channel default_debug {
file "/var/log/named.run";
severity dynamic;
print-time yes;
};

channel queries_channel {
file "/var/log/queries.log";
severity dynamic;
print-time yes;
print-severity yes;
};
channel security_channel {
file "/var/log/security.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

channel update_security_channel {
file "/var/log/updates.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

channel dnssec_channel {
file "/var/log/dnssec.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

channel xfers_channel {
file "/var/log/zone_transfers.log" versions 3 size 5m;
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};

category queries { queries_channel; };
category security { security_channel; };
category update-security { update_security_channel; };
category dnssec { dnssec_channel; };
category xfer-out { xfers_channel; };
};
zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
----------------------------------------------------------------
My DNS Server works fine. Only it cannot make the log.
when I will run this command:
#dig -x 10.40.124.2
the result comes fine but the log is not make in /var/log/queries.log file.
The named is running without chroot enviroment.
Please help me in solving this.

How Often A Root Dns Server Is Queried

I havent found out any straight-to-the-point answear yet on the net about how often a root dns server is queried hence i thought i should ask here.

When i use "dig +trace" i notice that my queries allways start from the root "." servers. However, is this also happening with, lets say, a recursive (resolver) dns server?

For example, lets assume that i use at home google's dns servers (8.8.8.8). Is google dns server will indeed first head to the root "." dns server when i query for example.net?

Thanks

"vconsole.conf" Show Unicode

Hi!

Here is mine configuration and I want make it show unicode(russian) in console, it works perfect in X11 but not when I logging into tty.

vconsole.conf
Code:
LOCALE="en_US.UTF-8"
KEYMAP="sv-latin1"
FONT_UNIMAP="lat1"
FONT_MAP="ISO8859-1"
CONSOLEFONT="ruscii_8x8"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/Stockholm"
USECOLOR="yes"

Rsync Script Problem

Hi all,

I am trying to write a script that syncs files from source to destination. I have one centralized server that can ssh to any servers without pw. Now when I run the script, it can ssh to source server perfectly fine, but you need to enter password for destination server. Was wondering how I can clean this up before I start using case statements

Below is a sample I wrote

#!/bin/bash

#This scripts syncs shit

echo "Type in ID: "
read ID

echo "Type in Server : " #source server
read S

echo "Type in Destination Server: "
read DS

if [ $S == 9 ]; then
ssh -t "root@"$S"webserver1" "rsync -av /home/rlui/"$ID "root@"$DS"webserver2:/home/rlui/";
ssh -t "root@"$S"webserver1" "rsync -av /home/rlui/tmp/"$ID "root@sl"$DS"webserver2:/home/rlui/tmp/"
exit 1

where S and DS are cluster numbers

I apologize in advance if I am not clear on anything

Rsync, Reliable "copy And Paste" Type Of Backup In Case Things Break?

What I did in windows was create images of my drive and restore them.

in linux I am running

Code:
rsync -aAXv --exclude={"/home/*","/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder

and this creates a folder for me with all my files, and apparently saves meta data like permissions and paths...

Since I'm using arch and things break sometimes,I'm booted into a CLI with errors and cannot figure my way out since I'm a noob... would I be able to just delete my entire root and replace it with the rsync backup without a problem?

Connecting To Specific Directory With Filezilla

Hello, I have an embedded linux device. I can connect to the device and I can upload or download files. No problem with this. But, at first connection, I want to connect to "/" directory instead of "/root". In the device file system, there are files ssh_config and sshd_config under /etc/ssh directory. I think I have to do something with these files but I don't know what.

I don't exactly know what mean "/root" and "/" directories. I think that the real root directory is "/" directory which is empty but when I connect with filezilla, the "/root" directory is the default so I had to go back to / directory everytime.

Using Cut -d" " To Cut Out The String Before, Not After

Hi Guys,
i have this Code:
uid=0(root) gid=0(root)

i would like to have the word "root" only from the first field, and later from the second field

i use the command
Code:
[root@v1-6 ~]# cat test-uid |cut -d"(" -f1
brms2
uid=0

[root@v1-6 ~]# cat test-uid |cut -d")" -f1
brms2
uid=0(root

it cut the word after the -d, how can i make it to cut the word BEFORE the -d

expected should be:
cut -d"(" -f1
root)

then i can proceed to eliminate the ) later on.
hope this is not confusing you guys

Thanks,

Regular Expression In Expect Script To Prevent Printing To Screen

Hello, I have an expect script where I ssh to a remote host to determine the network configuration and get from the user the network interface card that should be used. From their response, I determine the subnet mask and save the information to a text file that is later transmitted back to my local host. This is all so that I can set up virtual IP aliasing and verify that the physical IP address of the local and remote host are on the same subnet prior to continuing with the setup. I am running the script on Linux, with expect version 5.45.

The code itelf works just fine, but I'm having some issues with how it displays on the screen. As you'll see below in the example, the default system prompt displays, as does the user input command that I'm sending to the shell from the expect script.

Is there a regular expression or something that I can write to prevent the prompt and command that I'm sending from printing to the screen? I know that it should be suppressed if I have an expect command following the Code:
send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0):   '\r

command, but everything I have tried for strings and regular expressions to expect causes the netstat -rn output to not show up all of a sudden. I'm new to expect, so I'm not really sure why this is happening.

I would really appreciate any help/suggestions. Thanks for your time!

Part of the Script Code:
Code:
expect {
   -re $prompt {   ;# Send individual commands and get user input
        set timeout -1
        
        # Get partner hostname and put in vipsetup.txt file
        send -s "hostname > vipsetup.txt\r"  
        expect -re $prompt
        
        # Display the network routing info for the user and prompt for 
        # network interface card number
        send -s "print \"The network routing table for the $ptner server is displayed below:\n\" ; netstat -rn \r"
        
        expect -re "\r(.*):\r"
        send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0):   '\r"
        interact "\r" return    ;# Wait for user input from read command
        send -- "\r"
        send -s "echo \$n_card >> vipsetup.txt\r"  
        
        # Obtain subnet mask information for partner based on network 
        # interface card number being used
        send -s "msk=\$(cat /etc/sysconfig/network-scripts/ifcfg-\$n_card | grep NETMASK)\r"
        send -s "msk=\$(echo \${msk#NETMASK=})\r"
        send -s "echo \$msk >> vipsetup.txt\r"
    }
    timeout {
        send_user "Connection to host $hostip timed out."
        exit 6 
    }
    eof {
        send_user "Connection to host $hostip failed."
        exit
    }
}


Script Output:
Code:
The network routing table for the PRIMARY server is displayed below:
 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.105.65.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         10.105.65.1     0.0.0.0         UG        0 0          0 eth0
 [root@remotehost root]$
[root@remotehost root]$ ber for this server (i.e. eth0):   '              < 
Enter the network interface card number for this server (i.e. eth0):   eth0

Sendmail Alias Not Working

I'm trying to send all root's mails to an external e-mailaddress, but for some reason I can't get it to work.

I've edited /etc/aliases with the following rule:

root: <myexternal@email.address>

and run newaliasses after, which would run without any errors.

I can run: echo "Testing" | mail -s "Server Testing" <myexternal@email.address>
just fine without any issue and it's being delivered correctly to my external address.

But when I run: echo "Testing" | mail -s "Server Testing" root

I (first) get a "Deferred: 451 Temporary local problem - please try again later" error and when I then run: "Sendmail -OTimeout.hoststatus=0m -q -v" to flush the mailqueue it says everything is ok, but I then get a message saying I have new mail in /var/spool/mail/root and I don't get the mail on my external e-mailaddress.

I have no clue where to look next, hopefully you guys can point me in the right direction.

Just for completeness: I use mageia release 4 (x86_x64).

Apache Not Working Properly After Update To Debian 8

Hi,
I just upgraded my server from Debian 7 to Debian 8. Everything seemed to go fine. However, Apache doesn't seem to be able to see the web files. If I go to my server's IP, I get an empty directory listing, as if the document root was pointed to an empty directory. However, my apache.conf points to /var/www, and there are indeed files the
Code:
root@maples-server:~# ls -la /var/www/
total 624
drwxr-xr-x  5 www-data www-data   4096 Apr 28 19:35 .
drwxr-xr-x 13 root     root       4096 Mar 28 11:43 ..
lrwxrwxrwx  1 www-data www-data     18 Jan 10 20:47 anthony -> /home/anthony/web/
-rw-------  1 www-data www-data   1455 Apr 23 21:41 .bash_history
-rw-r--r--  1 www-data www-data   3388 Jan 21 19:34 .bashrc
drwxr-xr-x 11 www-data www-data   4096 Apr 23 21:41 chat
lrwxrwxrwx  1 www-data www-data     14 Mar 23 16:20 dad -> /home/dad/web/
drwxr-xr-x  2 root     root       4096 Mar 15 05:52 html
-rw-r--r--  1 www-data www-data    323 Mar 26 18:35 index.htm
drwx------  2 www-data www-data   4096 Jan 21 19:50 Mail
-rw-r--r--  1 anthony  anthony  592795 Apr 23 19:52 phpfreechat-1.7.tar.gz
-rw-r--r--  1 www-data www-data     41 Apr 15 21:52 robots.txt
-rw-------  1 www-data www-data   1541 Apr 23 21:41 .viminfo

Here's my apache.conf (with the comments stripped; there were no "end of line" comments):

Code:
root@maples-server:~# cat /etc/apache2/apache2.conf | grep -v "#"

Mutex file:${APACHE_LOCK_DIR} default

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5


User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

Include ports.conf


<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
	Require all denied
</FilesMatch>


LogFormat "v:p h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


IncludeOptional conf-enabled/*.conf

IncludeOptional sites-enabled/*.conf

I also checked sites-enabled/000-default, and everything seems to be fine the
Code:
root@maples-server:~# cat /etc/apache2/sites-enabled/000-default 
<VirtualHost *:80>

	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride All
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride All
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Additionally, the connections are no longer showing up in /var/log/apache2/access.log. The last access time in that file is from before the update. I don't know enough about systemd to know if it is responsible for redirecting the logs to somewhere else...

At this point, I have no idea why it's not working. If anyone could point me in the right direction, I would really appreciate it.
Thanks!

EDIT: After looking around some more, it seems that the output of "apachectl -S" is helpful. So here it is:
Code:
root@maples-server:~# apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33

It appears that it's looking in a subdirectory html, which was not the case previously (before the upgrade). I've currently got a (ugly but useable) work-around using a symlink:
Code:
root@maples-server:~# cd /var/www/
root@maples-server:/var/www# rm -r html/
root@maples-server:/var/www# ln -s /var/www/
root@maples-server:/var/www# mv www html
root@maples-server:/var/www# ls -l html
lrwxrwxrwx 1 root root 9 Apr 28 22:36 html -> /var/www/

While this does work, I'd like to find the proper way of doing it. Any ideas?