<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://freebsdwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=216.110.12.175</id>
		<title>FreeBSDwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=216.110.12.175"/>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Special:Contributions/216.110.12.175"/>
		<updated>2026-06-05T11:32:29Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://freebsdwiki.net/index.php/Named.conf</id>
		<title>Named.conf</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Named.conf"/>
				<updated>2007-06-17T15:06:49Z</updated>
		
		<summary type="html">&lt;p&gt;216.110.12.175: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== named.conf ==&lt;br /&gt;
&lt;br /&gt;
'''Named.conf''' controls system-wide configuration of [[named]] (*nix's standard [[DNS]] server, the Berkeley Internet Name Daemon), and also tells it where to find the files used to control individual domains, which are usually referred to as '''zones''' when discussing DNS administration.  &lt;br /&gt;
&lt;br /&gt;
Here is an sample '''named.conf''', in which the global section instructs [[named]] to try to resolve queries through an ISP's DNS servers before falling back on the [[root servers]] if the ISP's servers fail to respond.  After that, a few sample zone configurations are given - but as you will see, in most cases, the majority of the detail in individual zones is in the '''zone files''' themselves.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;// $FreeBSD: src/etc/namedb/named.conf,v 1.6.2.4 2001/12/05 22:10:12 cjc Exp $&lt;br /&gt;
//&lt;br /&gt;
// Refer to the named.conf(5) and named(8) man pages for details.  If&lt;br /&gt;
// you are ever going to setup a primary server, make sure you've&lt;br /&gt;
// understood the hairy details of how DNS is working.  Even with&lt;br /&gt;
// simple mistakes, you can break connectivity for affected parties,&lt;br /&gt;
// or cause huge amount of useless Internet traffic.&lt;br /&gt;
&lt;br /&gt;
options {&lt;br /&gt;
        directory &amp;quot;/etc/namedb&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Limit to using forwarders ONLY by enabling the following line:&lt;br /&gt;
//&lt;br /&gt;
//      forward only;&lt;br /&gt;
&lt;br /&gt;
// Set forwarders to attempt to resolve DNS queries at lower-level&lt;br /&gt;
// caching DNS servers (typically, your ISP's), reducing load on &lt;br /&gt;
// the root servers and the internet in general.  NOTE: even without&lt;br /&gt;
// setting &amp;quot;forward only&amp;quot;, using frequently-broken forwarders will, &lt;br /&gt;
// sadly, DRASTICALLY impact your own performance.&lt;br /&gt;
&lt;br /&gt;
      forwarders {&lt;br /&gt;
              4.21.223.2;&lt;br /&gt;
              4.21.223.2;&lt;br /&gt;
      };&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
      // Set query-source address to force a specific source port&lt;br /&gt;
      // for outbound queries.&lt;br /&gt;
      //&lt;br /&gt;
        // query-source address * port 53;&lt;br /&gt;
&lt;br /&gt;
        /*&lt;br /&gt;
         * Specify a location for the dumpfile (may be necessary if running in a sandbox)&lt;br /&gt;
         */&lt;br /&gt;
        // dump-file &amp;quot;s/named_dump.db&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// If you are running a local name server, don't forget to put 127.0.0.1 in the first place&lt;br /&gt;
// in your &amp;lt;/nowiki&amp;gt;[[/etc/resolv.conf]] and enable it in /[[etc/rc.conf]].&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Ultimately, DNS queries are an example of hierarchical buck-passing: root queries begin&lt;br /&gt;
// with the [[root servers]] for the internet, which don't know the answer, and possibly not&lt;br /&gt;
// even who does know the answer - but they know how to get you one step closer.  The buck keeps&lt;br /&gt;
// passing downwards until you finally reach the [[authoritative nameserver]] for the record&lt;br /&gt;
// you're trying to resolve. This entry points out the [[root servers]] if your server should&lt;br /&gt;
// need them.&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;.&amp;quot; {&lt;br /&gt;
        type hint;&lt;br /&gt;
        file &amp;quot;named.root&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// This is a simple &amp;quot;reverse zone&amp;quot;, which points IP addresses to [[canonical DNS names]] instead&lt;br /&gt;
// of vice-versa.  Ideally, you should have a complete zone file for your LAN IP space as well as&lt;br /&gt;
// the subnet your WAN occupies.  In practice, many smaller companies never get this done properly.&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;0.0.127.IN-ADDR.ARPA&amp;quot; {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;localhost.rev&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// This is a reverse IPv6 zone.  We won't have enough IPv4 (dotted quad style) addresses for &lt;br /&gt;
// everybody forever.  Life will not be fun when six-bone is a necessity.  Life will be even LESS&lt;br /&gt;
// fun in the last, gruesome days of the necessary switch.  (Look at this monster!)&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.INT&amp;quot; {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;localhost.rev&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// This is a simple slave zone.  We don't actually write or control this zone file, we just&lt;br /&gt;
// ask its real master if we can have a copy of it so that we can help distribute it to others.&lt;br /&gt;
// NOTE: attempting to slave a domain that you don't have any business with is VERY frowned upon.&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;slavedomain.com&amp;quot; {&lt;br /&gt;
        type slave;&lt;br /&gt;
        file &amp;quot;zones/slavedomain.com&amp;quot;;&lt;br /&gt;
        masters {&lt;br /&gt;
                65.43.99.11;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// This is a simple master zone.  We originate and control the zone file which describes this&lt;br /&gt;
// zone.  We may or may not choose to allow others to slave it for us.  In this case, we are&lt;br /&gt;
// not securing it, so anyone who wants to slave it may do so.&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;masterdomain.net&amp;quot; {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;zones/masterdomain.net&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// This is a dynamically updated zone.  We originate and control it, but only a small &amp;quot;seed&amp;quot;&lt;br /&gt;
// is statically maintained on the server - the rest is updated, deleted, refreshed, etc by&lt;br /&gt;
// clients with no fixed IP address as they need to in order to let others find them.  The &lt;br /&gt;
// privilege to update records in this zone is secured with a crypto key.  The key is *not*&lt;br /&gt;
// visible to simple queries from the internet.&lt;br /&gt;
&lt;br /&gt;
key dynamic.domain.net. {&lt;br /&gt;
        algorithm &amp;quot;HMAC-MD5&amp;quot;;&lt;br /&gt;
        secret &amp;quot;omr5O5so/tZB5XeGuBBf42rrRJRQZB8I9f uIIxxei8qm7AVgNBprxtcU FQMzBvU/Y nyM2xbs/C8kF3eJQUA==&amp;quot;&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;dynamic.domain.net&amp;quot; {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;zones/dynamic.domain.net&amp;quot;;&lt;br /&gt;
        allow-update{&lt;br /&gt;
                key dynamic.domain.net;&lt;br /&gt;
        };&lt;br /&gt;
};&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Zone files ==&lt;br /&gt;
&lt;br /&gt;
This is a simple '''zone file''' which corresponds to the '''masterdomain.net''' entry outlined in the sample '''named.conf''' above.  In our example configuration, this file is /etc/namedb/zones/masterdomain.net.&lt;br /&gt;
&lt;br /&gt;
 $ORIGIN net.&lt;br /&gt;
 $TTL 5m&lt;br /&gt;
 &lt;br /&gt;
 masterdomain    IN     SOA    www.masterdomain.net. hostmaster.www.masterdomain.net. (&lt;br /&gt;
                                   1               ; serial&lt;br /&gt;
                                   4h              ; refresh&lt;br /&gt;
                                   15m             ; retry&lt;br /&gt;
                                   8h              ; expire&lt;br /&gt;
                                   4m)             ; negative caching TTL&lt;br /&gt;
                 IN      NS      ns1.masterdomain.net.&lt;br /&gt;
                 IN      NS      ns2.masterdomain.net.&lt;br /&gt;
                 MX      10      mail.masterdomain.net.&lt;br /&gt;
                 IN      A       68.96.111.12&lt;br /&gt;
 &lt;br /&gt;
 $ORIGIN masterdomain.net.&lt;br /&gt;
 www             IN      CNAME   masterdomain.net.&lt;br /&gt;
 ns1             IN      A       68.96.111.10&lt;br /&gt;
 ns2             IN      A       68.96.111.11&lt;br /&gt;
&lt;br /&gt;
This is a very simple (but serviceable) zone file, with one webserver that responds to either masterdomain.net or www.masterdomain.net, and two individual nameservers.  (These nameservers will also have A records configured in the [[root servers]], since masterdomain.net is a second level domain.  For more complex examples, see also [[DNS record types]] and [[BIND (dynamic DNS)]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Important Config Files]]&lt;/div&gt;</summary>
		<author><name>216.110.12.175</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php/At</id>
		<title>At</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/At"/>
				<updated>2007-06-17T04:45:41Z</updated>
		
		<summary type="html">&lt;p&gt;216.110.12.175: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''at''' scheduler is used to schedule a job for one-time-only running at a later date.  For comparison, the [[cron]] scheduler is used to schedule jobs for repeated execution at regular intervals.  One very handy use of the '''at''' scheduler is to schedule lengthy jobs to run in the background immediately - that way even if you need to (or are forced to) close your [[shell]] session, your job will continue running.&lt;br /&gt;
&lt;br /&gt;
The basic syntax of '''at''' is to type '''at''' followed by a time (specified in [[POSIX time format]]) you wish your new job to be executed.  Examples would be &amp;quot;at now&amp;quot; to run the job immediately, &amp;quot;at 0400&amp;quot; to run the job at 4 AM today, or &amp;quot;at 200409282300&amp;quot; to run the job at 11:00 PM on September 28th of 2004.  Once this is done, you enter interactive mode, and any further commands you type will be part of the '''at''' job scheduled.  Once you're done entering in commands to be scheduled, you press CTRL-D (aka the [[eof]] character) and the scheduler tells you what your job number is and what shell it will be executed with (typically /bin/sh by default).&lt;br /&gt;
&lt;br /&gt;
 ph34r#''' at now'''&lt;br /&gt;
 '''cvsup /usr/share/examples/cvsup/ports-supfile'''&lt;br /&gt;
 ''' ''&amp;lt;nowiki&amp;gt;[user presses CTRL-D]&amp;lt;/nowiki&amp;gt;'' '''&lt;br /&gt;
 Job 3 will be executed using /bin/sh&lt;br /&gt;
 ph34r#&lt;br /&gt;
&lt;br /&gt;
You may also use the -f option to specify a file that contains the list of commands you wish to process - for example:&lt;br /&gt;
&lt;br /&gt;
 ph34r#''' echo &amp;quot;cvsup /usr/share/examples/cvsup/ports-supfile&amp;quot; &amp;gt; at-job.txt'''&lt;br /&gt;
 ph34r#''' at -f at-job.txt now'''&lt;br /&gt;
 Job 5 will be executed using /bin/sh&lt;br /&gt;
 ph34r#&lt;br /&gt;
&lt;br /&gt;
If all you want to do is force a job started from the shell into the background, you can do that without using '''at''' simply by adding an ampersand to the end of your command line - for example:&lt;br /&gt;
&lt;br /&gt;
 ph34r#''' cvsup /usr/share/examples/cvsup/ports-supfile&lt;/div&gt;</summary>
		<author><name>216.110.12.175</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php/OpenVPN</id>
		<title>OpenVPN</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/OpenVPN"/>
				<updated>2007-06-17T03:27:41Z</updated>
		
		<summary type="html">&lt;p&gt;216.110.12.175: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://openvpn.sourceforge.net OpenVPN] is a very useful open source, cross platform Virtual Private Networking tool.  It uses SSL encryption (dynamic or 2048-bit static shared key), can use LZO stream compression, and is blindingly fast as well as much more secure compared to typical industry standard IPSEC   DES or IPSEC   3DES solutions.  Better yet, it's so simple it can be run entirely from the command line.&lt;br /&gt;
&lt;br /&gt;
==Installing==&lt;br /&gt;
To build it on a FreeBSD machine, just:&lt;br /&gt;
&lt;br /&gt;
 cd /usr/ports/security/openvpn&lt;br /&gt;
 make install clean&lt;br /&gt;
&lt;br /&gt;
it's that easy.  Actually doing anything with it will require a little more work.  There are many MANY ways to do this, but this one's useful, simple, and clean.&lt;br /&gt;
&lt;br /&gt;
First, generate yourself a private key file and '''chmod''' it so that only its owner can read it:&lt;br /&gt;
&lt;br /&gt;
 ph34r# '''openvpn --genkey --secret /usr/local/etc/openvpn.key'''&lt;br /&gt;
 ph34r# '''chmod 400 /usr/local/etc/openvpn.key'''&lt;br /&gt;
&lt;br /&gt;
==Starting OpenVPN==&lt;br /&gt;
Now you'll need a command to start it with.  It can be done purely from the command line - and in fact, in one sense, that's exactly what we're going to do - but to make our lives a little easier, we'll ''actually'' use command line stuff from a shell script in '''/usr/local/etc/rc.d'''.  So place this - or something similar - in your '''/usr/local/etc/rc.d''':&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
        # VPN subnets are contained in 10.10.x.x / 255.255.0.0&lt;br /&gt;
        # port range forwarded through the router is 4900-4982 &lt;br /&gt;
  &lt;br /&gt;
        # first make sure the TAP module is loaded&lt;br /&gt;
        kldload if_tap &lt;br /&gt;
 &lt;br /&gt;
        # now ensure IP forwarding is enabled&lt;br /&gt;
        /sbin/sysctl -w net.inet.ip.forwarding=1&lt;br /&gt;
 &lt;br /&gt;
        # Now, make sure there are enough tun* / tap* devices in /dev&lt;br /&gt;
        cd /dev&lt;br /&gt;
        /bin/sh MAKEDEV tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap8 tap9&lt;br /&gt;
 &lt;br /&gt;
        # Finally, open up for business.&lt;br /&gt;
        # A tunnel numbered [x] is configured as follows:&lt;br /&gt;
        # device tun[x], port (4900   [x]), network 10.10.(10   [x])&lt;br /&gt;
        # Client machine is always .2, server is always .1&lt;br /&gt;
 &lt;br /&gt;
        # note - ping-restart on server end with disconnected clients&lt;br /&gt;
        # seems to be the problem resulting in exhausted mbufs.  Trying&lt;br /&gt;
        # ping-restart on client end only and hoping for the best.&lt;br /&gt;
 &lt;br /&gt;
        # 0. Server side - dynamic VPN&lt;br /&gt;
        /usr/local/sbin/openvpn \&lt;br /&gt;
        --dev tap0 --port 4900 --ifconfig 10.10.10.1 255.255.255.252 \&lt;br /&gt;
        --tun-mtu 1500 --tun-mtu-extra 32 --mssfix 1450 --key-method 2 \&lt;br /&gt;
        --secret /usr/local/etc/openvpn.key --ping 1&lt;/div&gt;</summary>
		<author><name>216.110.12.175</name></author>	</entry>

	</feed>