kubernetes v1.11.3 (HA cluster) + k8s.gcr.io/coredns:1.1.3 + aws
kind: Service
apiVersion: v1
metadata:
name: test-domain-service
spec:
type: ExternalName
externalName: kubernetes.io
---
kind: Service
apiVersion: v1
metadata:
name: test-ip-service
spec:
type: ExternalName
externalName: 104.198.14.52
kubectl exec) one pod to access these services
kubernetes can resolve these two service as well

Actually I want to create service below:
kind: Service
apiVersion: v1
metadata:
name: test-domain-service
spec:
type: ExternalName
externalName: ip-10-10-10-204.xxxxxx.compute.internal
---
kind: Service
apiVersion: v1
metadata:
name: test-ip-service
spec:
type: ExternalName
externalName: 10.10.10.204
As you see, they are aws EC2 private DNS name and private IP of one machine, the same result as the experiment.
I also have tried to create service like this but failed to resolve it:
kind: Service
apiVersion: v1
metadata:
name: test-ip-service
spec:
type: ExternalName
externalName: 10.10.10.204
ports:
- port: 3306
protocol: TCP
Is there any feature or design that coreDns can't resolve service which forwards to an ip address?
Similary question : https://discuss.kubernetes.io/t/service-externalname-ip/494/5
It is unclear what you expect. In your example, you say that "kubernetes can resolve these two service...", but in the graphic that follows it, both results are "Not Found" ...
It's odd that an IP is allowed in the "externalName" field. The k8s documentation I found seems to infer that a IP in the field would not make sense:
ExternalName: Maps the service to the contents of the externalName field (e.g. foo.bar.example.com), by returning a
CNAMErecord with its value. No proxying of any kind is set up. This requires version 1.7 or higher of kube-dns.
... AFIAK, a CNAME value cant be an IP.
If you want a service that resolves to a statically defined ip address, you could ...
e.g.
apiVersion: v1
kind: Service
metadata:
name: gdns
namespace: default
spec:
clusterIP: None
ports:
- name: dns
port: 53
protocol: UDP
---
kind: Endpoints
apiVersion: v1
metadata:
name: gdns
namespace: default
subsets:
- addresses:
- ip: 8.8.8.8
ports:
- port: 53
name: dns
protocol: UDP
Thanks for response!
domain-service should perform the same as ip-service . ip-valued-CNAME always work both in kubeadm v1.6 , It looks like some version issues : )/label: kubernetes
Most helpful comment
It is unclear what you expect. In your example, you say that "kubernetes can resolve these two service...", but in the graphic that follows it, both results are "Not Found" ...
It's odd that an IP is allowed in the "externalName" field. The k8s documentation I found seems to infer that a IP in the field would not make sense:
... AFIAK, a
CNAMEvalue cant be an IP.If you want a service that resolves to a statically defined ip address, you could ...
e.g.