I have a very particular requirement I have to implement and I’m not sure if a Service Entry helps me achieve it.
I have a dns name and an IP address.
DNS: DNS_NAME.com
IP: 1.1.1.1
If I try to resolve that DNS name (Public domain) using nslookup it comes back with 2.2.2.2
.
My goal is to have DNS_NAME.com resolve with 1.1.1.1
The only way I was able to achieve this was to add those parameters into hostAliases as part of the deployment shown below, however I was hoping to not use Host Aliases and create something on a global or namespace level.
hostAliases:
- ip: "1.1.1.1"
hostnames:
- "DNS_NAME.com"
Here is an example on what I tried so far
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: DNS
spec:
addresses:
- 1.1.1.1/32
endpoints:
- address: 1.1.1.1
ports:
https: 443
hosts:
- DNS_NAME.com
location: MESH_EXTERNAL
ports:
- name: https
number: 443
protocol: TLS
resolution: STATIC
What I expect to happen:
nslookup DNS_NAME.com ----> (1.1.1.1)
What happens:
nslookup DNS_NAME.com ----> (2.2.2.2)