camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Liguori (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > DNS
Date Wed, 11 Sep 2013 01:12:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/DNS">DNS</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~gliesian">Robert
Liguori</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code} <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">dns://operation
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">dns://operation[?options]
<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="DNS-DNS"></a>DNS</h2>
<p><b>Available as of Camel 2.7</b></p>

<p>This is an additional component for Camel to run DNS queries, using DNSJava. The
component is a thin layer on top of <a href="http://www.xbill.org/dnsjava/" class="external-link"
rel="nofollow">DNSJava</a>.<br/>
The component offers the following operations:</p>
<ul class="alternate" type="square">
	<li>ip, to resolve a domain by its ip</li>
	<li>lookup, to lookup information about the domain</li>
	<li>dig, to run DNS queries</li>
</ul>


<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Requires
SUN JVM</b><br />The DNSJava library requires running on the SUN JVM.<br/>
If you use Apache ServiceMix or Apache Karaf, you'll need to adjust the <tt>etc/jre.properties</tt>
file, to add <tt>sun.net.spi.nameservice</tt> to the list of Java platform packages
exported. The server will need restarting before this change takes effect.</td></tr></table></div>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>
for this component:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
    &lt;artifactId&gt;camel-dns&lt;/artifactId&gt;
    &lt;version&gt;x.x.x&lt;/version&gt;
    &lt;!-- use the same version as your Camel core version --&gt;
&lt;/dependency&gt;
</pre>
</div></div>

<h3><a name="DNS-URIformat"></a>URI format</h3>

<p>The URI scheme for a DNS component is as follows</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
dns://operation[?options]
</pre>
</div></div>

<p>This component only supports producers.</p>

<h3><a name="DNS-Options"></a>Options</h3>

<p>None.</p>

<h3><a name="DNS-Headers"></a>Headers</h3>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Operations </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> dns.domain </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> ip </td>
<td class='confluenceTd'> The domain name. Mandatory. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.name </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> lookup </td>
<td class='confluenceTd'> The name to lookup. Mandatory. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.type </td>
<td class='confluenceTd'><ul class="alternate" type="square">
	<li></li>
</ul>
</td>
<td class='confluenceTd'>  lookup, dig </td>
<td class='confluenceTd'> The type of the lookup. Should match the values of <tt>org.xbill.dns.Type</tt>.
Optional. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.class </td>
<td class='confluenceTd'><ul class="alternate" type="square">
	<li></li>
</ul>
</td>
<td class='confluenceTd'> lookup, dig</td>
<td class='confluenceTd'> he DNS class of the lookup. Should match the values of <tt>org.xbill.dns.DClass</tt>.
Optional. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.query </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> dig </td>
<td class='confluenceTd'> The query itself. Mandatory. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.server </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> dig </td>
<td class='confluenceTd'> The server in particular for the query. If none is given,
the default one specified by the OS will be used. Optional. </td>
</tr>
</tbody></table>
</div>
</div>

<h3><a name="DNS-Examples"></a>Examples</h3>

<h4><a name="DNS-IPlookup"></a>IP lookup</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
        &lt;route id="IPCheck"&gt;
            &lt;from uri="direct:start"/&gt;
            &lt;to uri="dns:ip"/&gt;
        &lt;/route&gt;
</pre>
</div></div>

<p>This looks up a domain's IP. For example, www.example.com resolves to 192.0.32.10.<br/>
The IP address to lookup must be provided in the header with key <tt>"dns.domain"</tt>.</p>

<h4><a name="DNS-DNSlookup"></a>DNS lookup</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
        &lt;route id="IPCheck"&gt;
            &lt;from uri="direct:start"/&gt;
            &lt;to uri="dns:lookup"/&gt;
        &lt;/route&gt;
</pre>
</div></div>

<p>This returns a set of DNS records associated with a domain.<br/>
The name to lookup must be provided in the header with key <tt>"dns.name"</tt>.</p>

<h4><a name="DNS-DNSDig"></a>DNS Dig</h4>
<p>Dig is a Unix command-line utility to run DNS queries.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
        &lt;route id="IPCheck"&gt;
            &lt;from uri="direct:start"/&gt;
            &lt;to uri="dns:dig"/&gt;
        &lt;/route&gt;
</pre>
</div></div>

<p>The query must be provided in the header with key <tt>"dns.query"</tt>.</p>


<h3><a name="DNS-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email notification preferences</a>
</div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/DNS">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=25203387&revisedVersion=5&originalVersion=4">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/DNS?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message