이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 36. DNS


DNS

Available as of Camel 2.7
This is an additional component for Camel to run DNS queries, using DNSJava. The component is a thin layer on top of DNSJava. The component offers the following operations:
ip
To resolve a domain by its IP address.
lookup
To look up information about the domain.
dig
To run DNS queries.
Requires SUN JVM
The DNSJava library requires running on the SUN JVM. If you use Apache ServiceMix or Apache Karaf, you'll need to adjust the etc/jre.properties file, to add sun.net.spi.nameservice to the list of Java platform packages exported. The server will need restarting before this change takes effect.
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-dns</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>
Copy to Clipboard Toggle word wrap

URI format

The URI scheme for a DNS component is as follows
dns://operation
Copy to Clipboard Toggle word wrap
This component only supports producers.

Options

None.

Headers

Expand
Header Type Operations Description
dns.domain String ip The domain name. Mandatory.
dns.name String lookup The name to lookup. Mandatory.
dns.type - lookup, dig The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.
dns.class - lookup, dig he DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.
dns.query String dig The query itself. Mandatory.
dns.server String dig The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.

Examples

IP lookup

        <route id="IPCheck">
            <from uri="direct:start"/>
            <to uri="dns:ip"/>
        </route>
Copy to Clipboard Toggle word wrap
This looks up a domain's IP. For example, www.example.com resolves to 192.0.32.10. The IP address to lookup must be provided in the header with key "dns.domain".

DNS lookup

        <route id="IPCheck">
            <from uri="direct:start"/>
            <to uri="dns:lookup"/>
        </route>
Copy to Clipboard Toggle word wrap
This returns a set of DNS records associated with a domain. The name to lookup must be provided in the header with key "dns.name".

DNS Dig

Dig is a Unix command-line utility to run DNS queries.
        <route id="IPCheck">
            <from uri="direct:start"/>
            <to uri="dns:dig"/>
        </route>
Copy to Clipboard Toggle word wrap
The query must be provided in the header with key "dns.query".
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat