<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>blueblog - by Christian J. Dietrich - Linux Hints</title>
    <link>http://blog.cj2s.de/</link>
    <description>on malware, botnets and security by Christian J. Dietrich</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    <pubDate>Wed, 10 Oct 2012 20:35:59 GMT</pubDate>

    <image>
        <url>http://blog.cj2s.de/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: blueblog - by Christian J. Dietrich - Linux Hints - on malware, botnets and security by Christian J. Dietrich</title>
        <link>http://blog.cj2s.de/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Delegating IN-ADDR.ARPA domains for reverse DNS resolution (PTR: IP to hostname)</title>
    <link>http://blog.cj2s.de/archives/24-Delegating-IN-ADDR.ARPA-domains-for-reverse-DNS-resolution-PTR-IP-to-hostname.html</link>
            <category>Linux Hints</category>
    
    <comments>http://blog.cj2s.de/archives/24-Delegating-IN-ADDR.ARPA-domains-for-reverse-DNS-resolution-PTR-IP-to-hostname.html#comments</comments>
    <wfw:comment>http://blog.cj2s.de/wfwcomment.php?cid=24</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.cj2s.de/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    

    <author>nospam@example.com (Christian J. Dietrich)</author>
    <content:encoded>
    Part of a clean DNS configuration is to maintain a mapping from IP addresses to hostnames. Especially in email exchange, many mail servers require that the sender&#039;s IP address can be looked up in DNS and e.g. maps to a hostname. You can easily test this using the tool dig which is usually part of bind-utils:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
$  dig  -x 80.67.18.126&lt;br /&gt;
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 19989&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;126.18.67.80.in-addr.arpa.     IN      PTR&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
126.18.67.80.in-addr.arpa. 86400 IN     PTR     mxlb.ispgateway.de.&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
The listing shows the lookup for a PTR record of (one of) the mail server&#039;s IP address(es) of my domain. dig provides the -x flag which behind the scenes makes a query for 126.18.67.80.in-addr.arpa. of resource record type PTR. Equivalently, you can issue &#039;dig 126.18.67.80.in-addr.arpa. PTR&#039;. As we can see from the output above, the IP address &lt;strong&gt;80.67.18.126&lt;/strong&gt; maps to the hostname &lt;strong&gt;mxlb.ispgateway.de.&lt;/strong&gt; (which in turn maps to 80.67.18.126 when querying for an A RR type).&lt;br /&gt;
&lt;br /&gt;
In order to be able to provide reverse mappings for a set of IP addresses that have been assigned, there should be a delegation (or referral) from the authoritative entity which assigned the IP addresses. Usually you will want to have CIDR ranges of IPv4 addresses delegated. Thus, let&#039;s assume the upstream ISP takes care of the whole /24 network &lt;strong&gt;1.2.3.0/24&lt;/strong&gt; (i.e. 1.2.3.0-1.2.3.255) and the subnet IP address range &lt;strong&gt;1.2.3.32/27&lt;/strong&gt; (i.e. 1.2.3.32-1.2.3.63) should be delegated from the authoritative (upstream ISP) nameserver A to (your) nameserver B. The following configuration snippets provide an example configuration for BIND and illustrate the required steps.&lt;br /&gt;
&lt;br /&gt;
Thus, A needs to be configured to delegate the DNS entries concerning the IP addresses 1.2.3.32/27 to the nameserver B as follows:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
; depending on your style of zone files, you might not have an $ORIGIN in them at all&lt;br /&gt;
$ORIGIN 3.2.1.IN-ADDR.ARPA.&lt;br /&gt;
@            IN  SOA   ns1.A.com. dnsadmin.A.com. (&lt;br /&gt;
                              2011052501; serial number&lt;br /&gt;
                              1h             ; refresh after&lt;br /&gt;
                              1h             ; retry update after&lt;br /&gt;
                              2w             ; expire after&lt;br /&gt;
                              1h             ; negative caching TTL)&lt;br /&gt;
              IN  NS      ns1.A.com.&lt;br /&gt;
              IN  NS      ns2.A.com.&lt;br /&gt;
&lt;br /&gt;
; here go PTR records for the IP address range 1.2.3.0-.31 which is not delegated to B&lt;br /&gt;
1            IN  PTR   some.absolute.hostname.example.com.&lt;br /&gt;
...&lt;br /&gt;
31           IN  PTR   note.that.relative.names.dont.make.sense.here.&lt;br /&gt;
&lt;br /&gt;
; here goes the referral for the subnet 1.2.3.32/27 to B&#039;s name server(s)&lt;br /&gt;
32/27         IN  NS  ns1.B.com.&lt;br /&gt;
32/27         IN  NS  ns2.B.com.    ; in case B has a second NS&lt;br /&gt;
&lt;br /&gt;
; Now comes an important part. the above statement does not suffice to refer queries to B&#039;s name server.&lt;br /&gt;
; In addition, we also have to define CNAMEs for ALL IP addresses in the subnet and map them to&lt;br /&gt;
; the referred domain 32/27.&lt;br /&gt;
32            IN  CNAME   32.32/27.3.2.1.IN-ADDR.ARPA.&lt;br /&gt;
; or alternatively&lt;br /&gt;
32            IN  CNAME   32.32/27&lt;br /&gt;
....&lt;br /&gt;
63            IN  CNAME   63.32/27  ; keep going from 32 to 63...&lt;br /&gt;
; ...or alternatively use the $GENERATE macro of BIND 8.2+&lt;br /&gt;
$GENERATE 32-63 $ CNAME $.32/27&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Note that we could have chosen ANY arbitrary name instead of 32/27 for the CNAME targets as well as the referral (one could even refer outside the in-addr.arpa tree). However, &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/tools.ietf.org/html/rfc2317&#039;]);&quot;  href=&quot;http://tools.ietf.org/html/rfc2317&quot; target=&quot;_blank&quot;&gt;RFC 2317&lt;/a&gt; recommends the above scheme (for good reason).&lt;br /&gt;
&lt;br /&gt;
On the &quot;target&quot; nameserver B, the zone looks similar to:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
$ORIGIN 32/27.3.2.1.IN-ADDR.ARPA.&lt;br /&gt;
@            IN  SOA   ns1.B.com. dnsadmin.B.com. ( ... )&lt;br /&gt;
              IN  NS      ns1.B.com.&lt;br /&gt;
              IN  NS      ns2.B.com.&lt;br /&gt;
&lt;br /&gt;
; provide the PTR mapping for the IP addresses 1.2.3.32-.63 (maybe omit first and &lt;br /&gt;
; last as they are network and broadcast addresses).&lt;br /&gt;
32            IN  PTR   some-net.b.example.com.&lt;br /&gt;
33            IN  PTR   host33.b.example.com.&lt;br /&gt;
....&lt;br /&gt;
62            IN  PTR   web.example.com.&lt;br /&gt;
63            IN  PTR   host63.example.com.&lt;br /&gt;
&lt;br /&gt;
; alternatively use the $GENERATE macro of BIND 8.2+&lt;br /&gt;
$GENERATE 32-63 $ PTR host$.b.example.com.&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
The configuration of the zone on the nameserver B is something like:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
...&lt;br /&gt;
    zone &quot;32/27.3.2.1.in-addr.arpa&quot; in {&lt;br /&gt;
      type master;&lt;br /&gt;
      file &quot;data/1.2.3.32_27.reverse.zone&quot;;&lt;br /&gt;
    };&lt;br /&gt;
...&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Testing the configuration&lt;/strong&gt;&lt;br /&gt;
Here are some commands using dig in order to test the configuration:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
; query one of the PTRs at B&#039;s nameserver&lt;br /&gt;
dig +norecurse  @[nameserver-of-B]  33.32/27.3.2.1.in-addr.arpa  PTR&lt;br /&gt;
&lt;br /&gt;
; query A&#039;s nameserver for the exact referral&lt;br /&gt;
dig +norecurse  @[nameserver-of-A]  32/27.3.2.1.in-addr.arpa  ANY&lt;br /&gt;
&lt;br /&gt;
; query A&#039;s nameserver for one of the PTRs&lt;br /&gt;
dig +norecurse  @[nameserver-of-A]  33.32/27.3.2.1.in-addr.arpa  PTR&lt;br /&gt;
dig +norecurse  @[nameserver-of-A]  33.3.2.1.in-addr.arpa  PTR&lt;br /&gt;
&lt;br /&gt;
; query one of the PTRs starting at the root&lt;br /&gt;
dig -x 1.2.3.33&lt;br /&gt;
dig +trace -x 1.2.3.33&lt;br /&gt;
&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Wed, 01 Jun 2011 19:03:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.cj2s.de/archives/24-guid.html</guid>
    
</item>
<item>
    <title>Compiling Gnuplot 4.4.2 on CentOS 5.5</title>
    <link>http://blog.cj2s.de/archives/19-Compiling-Gnuplot-4.4.2-on-CentOS-5.5.html</link>
            <category>Linux Hints</category>
    
    <comments>http://blog.cj2s.de/archives/19-Compiling-Gnuplot-4.4.2-on-CentOS-5.5.html#comments</comments>
    <wfw:comment>http://blog.cj2s.de/wfwcomment.php?cid=19</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.cj2s.de/rss.php?version=2.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    

    <author>nospam@example.com (Christian J. Dietrich)</author>
    <content:encoded>
    CentOS is a really fine platform for professional Linux servers which is - among others - characterized by stable software releases. However, especially in a research environment every once in a while you need a recent version of a software. CentOS ships with Gnuplot 4.0.0 but I need Gnuplot &gt;=4.4. In case others need this, too, here are my compile instructions:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
# make sure your system is uptodate&lt;br /&gt;
yum clean all&lt;br /&gt;
yum check-update&lt;br /&gt;
yum update&lt;br /&gt;
&lt;br /&gt;
# based on a minimal installation, you need some packages in order to compile, I suggest&lt;br /&gt;
yum install gcc gcc-c++ make libX11 xauth&lt;br /&gt;
yum install cairo-devel pango-devel freetype-devel gd-devel&lt;br /&gt;
&lt;br /&gt;
cd /usr/local/src/&lt;br /&gt;
wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.2/gnuplot-4.4.2.tar.gz/download&lt;br /&gt;
tar xzf gnuplot-4.4.2.tar.gz &lt;br /&gt;
cd gnuplot-4.4.2&lt;br /&gt;
less INSTALL&lt;br /&gt;
&lt;br /&gt;
# start compiling. I usually install self-compiled stuff at /opt/[PKG-NAME]&lt;br /&gt;
./configure --prefix=/opt/gnuplot442&lt;br /&gt;
make&lt;br /&gt;
# make sure the shipped version of gnuplot is removed (this is probably not necessary but prevents version mix-up)&lt;br /&gt;
yum remove gnuplot&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
# you might want to add a symlink&lt;br /&gt;
ln -s /opt/gnuplot442/bin/gnuplot /usr/bin/gnuplot&lt;br /&gt;
&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Wed, 01 Dec 2010 19:25:00 +0100</pubDate>
    <guid isPermaLink="false">http://blog.cj2s.de/archives/19-guid.html</guid>
    
</item>

</channel>
</rss>