Is it OK to write IP:port in the service name of a Bonjour service? - bonjour

I figured I could skip the resolving step by writing the IP address and port directly in the service name for each server, then browsing for my service by type. Are there any downsides to that?

Related

Google Stun server stun.l.google.com change IP?

I was using the Google Stun server by IP 74.125.143.127, but since 21/09/2021 it seems Google changed the IP of DNS stun.l.google.com.
I know I should use DNS rather fixed IP.
Any guys have some confirmation about the IP change?
tks
I know I should use DNS rather fixed IP
Yes. That's the answer. Full stop. Don't hardcode IP addresses to services in your app. The whole point of DNS... well, you know this right?
Some recent DNS lookups:
stun.l.google.com: 74.125.197.127
stun1.l.google.com: 173.194.193.127
stun2.l.google.com: 172.253.112.127
stun3.l.google.com: 173.194.77.127
stun4.l.google.com: 172.217.215.127
Testing the old IP you referenced that's not in the DNS entries above:
>stunclient 74.125.143.127
Binding test: fail
Testing the IP address that's currently being returned:
>stunclient 173.194.193.127
Binding test: success
Local address: 192.168.1.18:55004
Mapped address: 1.2.3.4:55004

Access ingress IP from a pod

I have got an authentication service. This service is behind an ingress (GKE in my case) for external API calls. When the signup function of the authentication service is called, it will send an email for email verification purpose. The link in this email has to point to the IP of ingress. In order to achieve that, my authentication service has to know the IP of the ingress. How can this be configured dynamically in k8s without storing the ingress IP[ address in a config file?
Many thanks in advance
Regards
Since by default GKE allocates ephemeral external IP address the simplest solution is to reserve static ip address. This can be done with new one or you can promote existing ephemeral IP to static one. With this solution the IP address is known in advance but the drawback of that the IP would have to be hardcoded into the application.
To avoid hardcoding this you could use nslookup to find ip address for this specific host. With this you should update your dns records with an address type record to point to you reserved static IP address. Please refer to your DNS service`s documentation on setting DNS A records to configure your domain name.
For more reading check how to configure static ip address.
The alternative way would be also to access the Kubernetes REST API directly and fetch the IP address from there. This depending on your architecture and application design will required appropriate authentication towards API.

Access external IP address from service

Is it possible to get the external IP address for a POD? It doesn't appear to be populating in the environmental variables for a service, so I was wondering if there was another way to get that information.
Basically: I'm setting up a proftpd service, and it needs to send out its external ip as well as a port for passive communication. Right now, it's sending the local IP address which is causing FTP clients to fail.
The kubernetes service discovery mechanism (DNS or environment variable) doesn't populate the external IP.
One way to work around is to create a static IP first, then assign it to your service.
Or you can exec kubectl inside your cluster to get the external IP but that's nasty.

GCE + K8S - Accessing referral IP address

With a standard Kubernetes deployment on Google Container Engine, to include services configured with the Kubernetes load balancer settings which creates network load balancers, is it possible to access the user's (or referring) IP address in an application? In the case of PHP, checking common headers in the $_SERVER superglobal only results in the server and internal network addresses being available.
Not yet. Services go through kube_proxy, which answers the client connection and proxies through to the backend (your PHP server). The address that you'd see would be the IP of whichever kube-proxy the connection went through.
Work has been done, and a tracking issue is still open to switch over to an iptables-only proxy. That would allow your PHP server to get the actual client IP.

How to get DNS name from REST service which is consumed by startuptask of Azure webrole

I have confirmed with that it's not possible to get DNS Name and environment details (staging vs production) without certificate & management API.
However let's consider my case in that my startuptask(exe) consume REST service to post some data so in that REST service can i do some trick to get DNS name?
I have tried with following
HttpContext.Current.Request.UserHostName however it is same as
HttpContext.Current.Request.UserHostAddress
Please give me suggestion if anyone have you did this type of trick.
Update
Using HostName & HostAddress i am able to get IP of that webrole (confirmed with browser request) but when i try that with nslookup command then it says me that Non-existent domain
Does Azure not support reverse lookup?
Thanks in Advance.
After I study the above details I would say that using above trick, you are getting the external facing VIP address about your service.
Lets consider in that case it would be something as below and if you have port 80 configured with your application you could use this IP address in any browser to verify and you did:
65.52.14.112
Now let's run nslook on IP address and it sure returns what you said:
C:\myTools>nslookup 65.52.14.112
Server: router.belkin
Address: 192.168.2.1
*** router.belkin can't find 65.52.14.112: Non-existent domain
Now for a second lets consider you know the hosted service name (it is my service and I know the name) so lets try to use nslookup with that:
C:\myTools>nslookup azurevmassistant.cloudapp.net
Server: router.belkin
Address: 192.168.2.1
Non-authoritative answer:
Name: azurevmassistant.cloudapp.net
Address: 65.52.14.112
As you can see above the hostname resolves the IP address and that's it. Also you would need to understand in both of the above case you were hitting the Windows Azure loadbalancer not the service itself.
I am able to verify that as of now the Windows Azure does not support "reverse lookup" and if you think that is important it is great chance to let your voice heard and submit the request here: http://www.mygreatwindowsazureidea.com/pages/34192-windows-azure-feature-voting