<p>Issue: I try to perform a cURL on a ExternalName service from within a temporary busybox pod, but the call just hangs. If I do the same cURL on the external name, not the service name, it works.</p>

<p>The following is the service yaml:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: google
spec:
  type: ExternalName
  externalName: google.com
</code></pre>

<p>I create the service with <code>kubectl create -f</code> then I create a temporary interactive busybox pod:</p>

<pre><code>kubectl run -i --tty busybox --image=sequenceiq/busybox --restart=Never -- sh
</code></pre>

<p>from which I perform the following cURLs:</p>

<pre><code>/ # curl google #hangs, have to interrupt
^C
/ # curl google.com

&lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&gt;
&lt;TITLE&gt;302 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
&lt;H1&gt;302 Moved&lt;/H1&gt;
The document has moved
&lt;A HREF="http://www.google.de/?gfe_rd=cr&amp;amp;ei=SQWDWYXTNZGg8wfFlIGQDw"&gt;here&lt;/A&gt;.
&lt;/BODY&gt;&lt;/HTML&gt;
</code></pre>

<p>So the obvious question is: Why is the first cURL hanging, but the second isn't, considering <code>google</code> is just a CNAME for <code>google.com</code>, as also confirmed by the following <code>host</code> output (performed from the interactive busybox)?</p>

<pre><code>/ # host google
google.default.svc.cluster.local is an alias for google.com.
google.com has address 172.217.18.174
google.com has IPv6 address 2a00:1450:4001:806::200e
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
</code></pre>

<p>The following is the verbosed output of the hanging cURL command</p>

<pre><code>/ # curl -vvv google
&gt; GET / HTTP/1.1
&gt; User-Agent: curl/7.38.0
&gt; Host: google
&gt; Accept: */*
&gt; 
</code></pre>

<p>Output describing the service (not possible to output as yaml):</p>

<pre><code>$ kubectl describe svc google
Name:             google
Namespace:        default
Labels:           &lt;none&gt;
Annotations:      &lt;none&gt;
Selector:         &lt;none&gt;
Type:             ExternalName
IP:         
External Name:    google.com
Session Affinity: None
Events:           &lt;none&gt;
</code></pre>

<p>You will need to set the host headers in the curl command</p>

<pre><code>$ curl -I google -H 'Host:google.com'
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Mon, 30 Dec 2019 03:49:12 GMT
Expires: Wed, 29 Jan 2020 03:49:12 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
</code></pre>
