How do you connect a client from a virtual machine. What is the domain?

I am writing an XMPP C# client (on a guest machine running Windows). In an example I have seen, the hostname/domain is example.com.

In the host machine, the domain is the name of the (my) server (pc). In Pidgin on the host machine, this works for the domain to be entered. In the guest OS, pc is the domain, but I also have to go through advanced settings and write in my host IP address. How would this be coded in?

Thanks for your time. This is probably a basic question but I haven’t been able to find an answer in hours

You can try adding IP as a server part like user@IP. But, this wouldn’t work as well as using your XMPP domain and specifying IP as a host as you client will think that your xmpp domain is the IP string. Don’t know how to code this.

I have tried that, no joy.

Do you know are SRV Records incorporated into Openfire? SRV Records - XMPP WIKI . Would that matter?

An XMPP domain is different from the hostname of the server that runs Openfire. They can be the same, but they do not need to be.

XMPP clients use DNS SRV records to determine what hosts can be used to connect when a user wants to log into an XMPP network.

Take, for example, user JohnDoe that has an account with the XMPP network “happychatters.com” (fictional - if this actually exists, that’s a coincidence).

Let’s assume that the happychatters XMPP domain consists of two servers (in a clustered setup):

happychatters should have set up various DNS SRV records, amongs which ones that allow clients to determine how to connect to the service (there ought to be more records, for server-to-server functionality, but that’s out of scope of this example). These could be the DNS SRV records that have been registered by happychatters.:

_xmpp-client._tcp.happychatters.com. 86400 IN SRV 5 50 5222 server-one.happychatters.com.

_xmpp-client._tcp.happychatters.com. 86400 IN SRV 5 50 5222 the-other-server.happychatters.com.

I won’t get into the nitty-gritty details of DNS SRV records, but this shows how the XMPP ‘client’ service for happychatters.com (first part of each record) maps to a port on specific hostnames (last part of each record). The other numbers in there are an indication on how weights and priorities should be calculated.

So, back to our client. When a user identifies itself as a user on the happychatters.com network (by using the Jabber Identifier johndoe@happychatters.com), the client should take the XMPP domain name, and perform a DNS SRV lookup. Based on the records above, it will find two hostnames, to which it can connect. That’s all to it.

You’ll find that DNS SRV records are not available for some XMPP domains. In such cases, clients typically fall back to the regular DNS records, and try to connect to a host that it finds through that. Lastly, most clients will allow users to define a specific connect host (which is typically part of an 'advanced configuration" setting in the client).

Thanks for clearing that up. So am I correct in saying that SRV Records are not required when two clients are communicating through the same local server?

That depends on your network setup. As long as the clients know how to access the server (based on their JID, or based on manual configuration), you’re good.

Great, thanks.

Would I be asking a bit much if you knew off the top of your head to code this into C#?

XMPP | XMPP Libraries

I’ve looked at a few of those. I haven’t seen anything for connecting through a virtual server. Thanks for your help anyway