Archive for the tag 'Understanding'

SBDavid

Understanding DNSBL Filtering

Understanding DNSBL Filtering

A DNSBL (commonly known as a ‘Blocklist”) is a database that is queried in realtime by Internet mail servers for the purpose of obtaining an opinion on the origin of incoming email. The role of a DNSBL such as Spamhaus’ SBL/XBL/PBL Advisory system is to provide an opinion, to anyone who asks, on whether a particular IP Address meets Spamhaus’ own policy for acceptance of inbound email.

The policy of the Receiver governs whether a message is blocked or not

Every Internet network that chooses to implement spam filtering is, by doing so, making a policy decision governing acceptance and handling of inbound email. The Receiver unilaterally makes the choices on whether to use DNSBLs, which DNSBLs to use, and what to do with an incoming email if the email message’s originating IP Address is “listed” on the DNSBL. The DNSBL itself, like all spam filters, can only answer whether a condition has been met or not.

SBDavid

Understanding Regular Expressions

Regular Expressions are a feature of UNIX. They describe a pattern to match, a sequence of
characters, not words, within a line of text.

Here is a quick summary of the special characters used in the grep tool and their meaning:

^ (Caret) = match expression at the start of a line, as in ^A.
$ (Question) = match expression at the end of a line, as in A$.
\ (Back Slash) = turn off the special meaning of the next character, as in \^.
[ ] (Brackets) = match any one of the enclosed characters, as in [aeiou]. Use Hyphen “-” for a range, as in [0-9].
[^ ] = match any one character except those enclosed in [ ], as in [^0-9].
. (Period) = match a single character of any value, except end of line.
* (Asterisk) = match zero or more of the preceding character or expression.
\{x,y\} = match x to y occurrences of the preceding.
\{x\} = match exactly x occurrences of the preceding.
\{x,\} = match x or more occurrences of the preceding.

Understanding basic vi (visual editor)

Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs.

Vim behaves differently, depending on the name of the command (the executable may still be the same file).

vim The “normal” way, everything is default.

ex Start in Ex mode. Go to Normal mode with the “:vi” command. Can also be done with the “-e” argument.

This first line is just to simply open a file with vi:

vi file-name

The following command is used to recover a file that was being edited when the system crashed:

vi -r file-name

The next command will open a file as read-only:

vi ew file-name

To move around in the editor

type h to type move the cursor to the left
type l to move it to the right
type k to move up
type j to move down

To search within VI

To search for text in vi you can use the “/” key followed by your search term. This example uses buddy:

/buddy

To quit and not save changes you can use:

:q!

If you want to quit and save changes you can use the following command:

:x!

Reference : man vi command line

SBDavid

Understanding the dig command

Understanding the dig command

dig will let you perform any valid DNS query, the most common of which are A (the IP address), TXT (text annotations), MX (mail exchanges), and NS nameservers.

The command dig is a tool for querying DNS nameservers for information about host addresses, mail exchanges, nameservers, and related information.

This tool can be used from any Linux (Unix) or Macintosh OS X operating system. The most typical use of dig is to simply query a single host.

$ dig serverbuddies.com
; <> DiG 9.5.1-P3 <> serverbuddies.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39970
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0

;; QUESTION SECTION:
;serverbuddies.com. IN A

;; ANSWER SECTION:
serverbuddies.com. 14043 IN A 67.228.43.85

A quick way to just get the answer only is to run the following command:

dig serverbuddies.com +short

Use the following command to get a list of all the mailservers for mt-example.com:

dig serverbuddies.com MX +noall +answer

Use the following command to get a list of authoritative DNS servers for mt-example.com:

dig serverbuddies.com NS +noall +answer