You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ma...@apache.org on 2020/08/28 14:51:46 UTC

[trafficcontrol] branch master updated: Allow Traffic Router binding DNS sockets to specific IP Address (#4967)

This is an automated email from the ASF dual-hosted git repository.

mattjackson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 00294da  Allow Traffic Router binding DNS sockets to specific IP Address (#4967)
00294da is described below

commit 00294da9613860a511a51db357a2b606d96dba8b
Author: Eric Friedrich <li...@users.noreply.github.com>
AuthorDate: Fri Aug 28 10:51:30 2020 -0400

    Allow Traffic Router binding DNS sockets to specific IP Address (#4967)
    
    Defaults to 0.0.0.0
    Can override port 53 tcp/udp listening socket by adding below to dns.properties
    dns.udp.host=x.x.x.x
    dns.tcp.host=x.x.x.x
---
 CHANGELOG.md                                                   |  1 +
 docs/source/admin/traffic_router.rst                           |  4 ++++
 .../core/src/main/webapp/WEB-INF/applicationContext.xml        | 10 ++++++++++
 3 files changed, 15 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e5413d5..f901c41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 - Added an indiciator to the Traffic Monitor UI when using a disk backup of Traffic ops.
 - Added debugging functionality to CDN-in-a-Box for Traffic Stats.
 - Added GitHub Actions workflow for building RPMs and running the CDN-in-a-Box readiness check
+- Added ability to set DNS Listening IPs in dns.properties
 
 ### Fixed
 - Fixed #3400 - Allow "0" as a TTL value for Static DNS entries
diff --git a/docs/source/admin/traffic_router.rst b/docs/source/admin/traffic_router.rst
index 1a6cd46..ea681e7 100644
--- a/docs/source/admin/traffic_router.rst
+++ b/docs/source/admin/traffic_router.rst
@@ -116,6 +116,10 @@ For the most part, the configuration files and :term:`Parameters` used by Traffi
 	|                            +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+
 	|                            | dns.tcp.backlog                           | Maximum length of the queue for incoming TCP connection requests                 | ``0``                                              |
 	|                            +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+
+	|                            | dns.tcp.host                              | IP Address Traffic Router will listen on for incoming TCP DNS requests           | ``0.0.0.0``                                        |
+	|                            +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+
+	|                            | dns.udp.host                              | IP Address Traffic Router will listen on for incoming UDP DNS requests           | ``0.0.0.0``                                        |
+	|                            +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+
 	|                            | dns.udp.port                              | UDP port that Traffic Router will use for incoming DNS requests                  | ``53``                                             |
 	|                            +-------------------------------------------+----------------------------------------------------------------------------------+----------------------------------------------------+
 	|                            | dns.max-threads                           | Maximum number of threads used to process incoming DNS requests                  | ``1000``                                           |
diff --git a/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml b/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml
index 02e8d38..9de67d5 100644
--- a/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/traffic_router/core/src/main/webapp/WEB-INF/applicationContext.xml
@@ -297,9 +297,14 @@
 		<constructor-arg index="4" ref="TCPBlockingQueue" />
 	</bean>
 
+	<bean id="DnsStreamInetAddress" class="java.net.InetAddress" factory-method="getByName">
+		<constructor-arg index="0" value="$[dns.tcp.host:0.0.0.0]" />
+	</bean>
+
 	<bean id="ServerSocket" class="java.net.ServerSocket">
 		<constructor-arg index="0" value="$[dns.tcp.port:53]" />
 		<constructor-arg index="1" value="$[dns.tcp.backlog:0]" />
+		<constructor-arg index="2" ref="DnsStreamInetAddress" />
 	</bean>
 
 	<bean id="TCP" class="com.comcast.cdn.traffic_control.traffic_router.core.dns.protocol.TCP">
@@ -312,8 +317,13 @@
 		<property name="taskTimeout" value="$[dns.tcp.timeout.task:5000]" />
 	</bean>
 
+	<bean id="DatagramInetAddress" class="java.net.InetAddress" factory-method="getByName">
+		<constructor-arg index="0" value="$[dns.udp.host:0.0.0.0]" />
+	</bean>
+
 	<bean id="DatagramSocket" class="java.net.DatagramSocket">
 		<constructor-arg index="0" value="$[dns.udp.port:53]" />
+		<constructor-arg index="1" ref="DatagramInetAddress" />
 	</bean>
 
 	<bean id="UDP" class="com.comcast.cdn.traffic_control.traffic_router.core.dns.protocol.UDP">