<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to use on prem Mysql server as we are not able to resolve the hostname in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-use-on-prem-mysql-server-as-we-are-not-able-to-resolve/m-p/23865#M16552</link>
    <description>&lt;P&gt;Since we are unable to resolve hostname, it point towards the DNS issue. We can use custom dns using init script and add in the cluster:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%scala
dbutils.fs.put("/databricks/&amp;lt;directory&amp;gt;/dns-masq.sh";,"""
#!/bin/bash
########################################
Configure on-prem dns access.
########################################
&amp;nbsp;
sudo apt-get update -y
sudo apt-get install dnsmasq -y --force-yes
&amp;nbsp;
## Add dns entries for internal your-company.net name servers
echo server=/databricks.net/10.X.Y.Z | sudo tee --append /etc/dnsmasq.conf
&amp;nbsp;
## Find the default DNS settings for the EC2 instance and use them as the default DNS route
&amp;nbsp;
ec2_dns=cat /etc/resolv.conf | grep "nameserver"; | cut -d' ' -f 2
echo "Old dns in resolv.conf $ec2_dns"
&amp;nbsp;
echo "server=$ec2_dns" | sudo tee --append /etc/dnsmasq.conf
&amp;nbsp;
## configure resolv.conf to point to dnsmasq service instead of static resolv.conf file
mv /etc/resolv.conf /etc/resolv.conf.orig
echo nameserver 127.0.0.1 | sudo tee --append /etc/resolv.conf
sudo service dnsmasq restart
""", true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://kb.databricks.com/cloud/custom-dns-routing.html" target="test_blank"&gt;https://kb.databricks.com/cloud/custom-dns-routing.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way is to use the IP address to connect.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 16:55:02 GMT</pubDate>
    <dc:creator>User16753724663</dc:creator>
    <dc:date>2021-06-16T16:55:02Z</dc:date>
    <item>
      <title>Unable to use on prem Mysql server as we are not able to resolve the hostname</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-use-on-prem-mysql-server-as-we-are-not-able-to-resolve/m-p/23864#M16551</link>
      <description>&lt;P&gt;while connecting from notebook, it returns the error unable to resolve name.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 16:53:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-use-on-prem-mysql-server-as-we-are-not-able-to-resolve/m-p/23864#M16551</guid>
      <dc:creator>User16753724663</dc:creator>
      <dc:date>2021-06-16T16:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use on prem Mysql server as we are not able to resolve the hostname</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-use-on-prem-mysql-server-as-we-are-not-able-to-resolve/m-p/23865#M16552</link>
      <description>&lt;P&gt;Since we are unable to resolve hostname, it point towards the DNS issue. We can use custom dns using init script and add in the cluster:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%scala
dbutils.fs.put("/databricks/&amp;lt;directory&amp;gt;/dns-masq.sh";,"""
#!/bin/bash
########################################
Configure on-prem dns access.
########################################
&amp;nbsp;
sudo apt-get update -y
sudo apt-get install dnsmasq -y --force-yes
&amp;nbsp;
## Add dns entries for internal your-company.net name servers
echo server=/databricks.net/10.X.Y.Z | sudo tee --append /etc/dnsmasq.conf
&amp;nbsp;
## Find the default DNS settings for the EC2 instance and use them as the default DNS route
&amp;nbsp;
ec2_dns=cat /etc/resolv.conf | grep "nameserver"; | cut -d' ' -f 2
echo "Old dns in resolv.conf $ec2_dns"
&amp;nbsp;
echo "server=$ec2_dns" | sudo tee --append /etc/dnsmasq.conf
&amp;nbsp;
## configure resolv.conf to point to dnsmasq service instead of static resolv.conf file
mv /etc/resolv.conf /etc/resolv.conf.orig
echo nameserver 127.0.0.1 | sudo tee --append /etc/resolv.conf
sudo service dnsmasq restart
""", true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://kb.databricks.com/cloud/custom-dns-routing.html" target="test_blank"&gt;https://kb.databricks.com/cloud/custom-dns-routing.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way is to use the IP address to connect.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 16:55:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-use-on-prem-mysql-server-as-we-are-not-able-to-resolve/m-p/23865#M16552</guid>
      <dc:creator>User16753724663</dc:creator>
      <dc:date>2021-06-16T16:55:02Z</dc:date>
    </item>
  </channel>
</rss>

