Adding IPv6 to existing server (DigitalOcean)

While creating the server I didn’t add any IPv6 address. Later from the Control Panel I enabled IPv6 but the address didn’t get attached to ETH0. Needed to do: Edit the /etc/network/interfaces.d/50-cloud-init.cfg file Add # control-alias eth0 iface eth0 inet6 static address 2400:xxxx:xxxx:xxxx:xxxx:xxxx:0000:6001/64 gateway 2400:xxxx:xxxx:xx::x autoconf 0 dns-nameservers 2001:xxxx:xxxx::xxxx 2001:xxxx:xxxx::xxxx The gateway and nameservers are… Continue reading Adding IPv6 to existing server (DigitalOcean)

Check DNS with DIG command

General Query dig @ns2.dnsserver.com TXT domain.com +short   With the +short it will show only the value of the queried field(s). Without +short  it will show the full result   Querying CNAME records  dig @ns2.dnsserver.com CNAME 4xugchxxxxxxxxxxxxxxxxxx3eread3uc._domainkey.domain.com +short This will return the value of that particular CNAME field.   Querying particular entry dig @ns2.dnsserver.com TXT domain.com… Continue reading Check DNS with DIG command

Bind server not responding to external queries

Recently I ran into a problem where one DNS server setup using Bind9 was not responding to external queries. systemctl status bind9 –no-pager –full  shows “Denied“ Common issues (listed below) that can cause the problem were not there. Bind9 was running properly The server was listening on both IPv4 and IPv6 Port 53 was open… Continue reading Bind server not responding to external queries

Manually adding a DNS Zone to Bind9 server

Create a Zone file in /etc/bind/  Example – /etc/bind/pri.domain.com Add the entries . Example below $TTL 3600 @ IN SOA ns2.dnserver.net. manish.gmail.com. ( 2019051606 ; serial, todays date + todays serial # 7200 ; refresh, seconds 540 ; retry, seconds 604800 ; expire, seconds 3600 ) ; minimum, seconds ; domain.com. 3600 A xxx.xxx.xxx.xxx mail… Continue reading Manually adding a DNS Zone to Bind9 server

Two Way Encryption or Hashing using Key

This is using PHP and openssl_decrypt/openssl_encrypt Encrypting the string $key = “xxxxxxxxxxx”; //11 characters $ivlen = openssl_cipher_iv_length(“aes-256-cbc-hmac-sha256″); $iv = openssl_random_pseudo_bytes($ivlen); $hash = openssl_encrypt(STRING TO HASH,”aes-256-cbc-hmac-sha256”,$key,0,$iv); $iv = bin2hex($iv); // iv generated is in binary – converted to HEX for passing through SESSION or POST or URL Decrypting back the string $key = “xxxxxxxxxxx”; $hash =… Continue reading Two Way Encryption or Hashing using Key