IP vs. Name on network

Hi Guys, just curious if anyone knows why sometimes using a servers IP rather than name is faster. For example, I have seen this when using RDP and Network shares, at both work and on my home network. If I understand things correctly, when using the name, your machine asks it’s DNS server what the IP is, and then just caches it and uses the IP anyway. I am not necessarily looking to troubleshoot anything, but just wanted to see if some people with a better understanding than me had some explanation for this. I am always looking to learn new things, so don’t be afraid to be overly technical - just be careful of OoA (overuse of acronyms)

1 Like

What is your local DNS server?

DNS lookup is lightning fast on a local network and should not add any delay, unless you are using something like a consumer all in one router/gateway to handle DNS, which is probably terrible

Its really best practice to always do things via hostname unless you have a good reason not to, as it makes changing IP’s of devices easy for when you migrate servers etc

2 Likes

Basically, every time you use a DNS name it needs to be looked up, like in a phone book. Then the returned response is the IP of the machine that that DNS name resolves to. If you think of it as dialing a phone number, it is always faster to dial a phone number directly versus looking it up in the phone book. If DNS is overwhelmed, then the returned response will always get delivered slower than expected. If DNS is down or too bogged down, you may not get a returned response at all. This is where time to live and what not comes in so that your machine does not continue to spin its wheels while it waits on a response.

Your understanding of DNS is pretty good except for the fact that an IP is always returned. I computer cannot do anything with a DNS name; this is true if you assume netbios is not a thing.

1 Like

Good thought, but I have a Ubiquiti Edgerouter X personally, no clue what my company uses. CPU activity on the Edgerouter is never higher than like 35%, pretty sure it isn’t slowing anything down. Also, I have noticed this across multiple places (different employers, home network, different routers, etc.) If I RDP to my home NAS (just a windows 10 box) using IP instead of name, it sometimes just seems so much faster. When I say faster, I mean just clicking around and mouse lag in general.

Couldn’t agree with this more, that’s why I stick to using the name for any settings or stuff like that. Just sometimes in the moment, if stuff seems especially slow, I will switch to IP and often notice less lag in my connection.

Something is up for sure. I’ve never noticed a speed difference using IP vs hostname.

Do you have local DNS entries for the devices you are connecting via IP? The only thing I can think is that maybe you don’t, and the client is having to figure out the IP of the device via other means

Where is it slower? just initial connection? On what part does it get “stuck”

I have had times where the DNS was out, so that obviously caused problems, but I guess I never tried checking to see if the DNS was overwhelmed at a particular point in time. I will try to double check the next time I am irked by this. I would be surprised if it is an issue though, I am running an Edgerouter X, so probably better than most home users.

I will have to go read up on netbios, not a clue what it is. Thanks.

The term escapes me right now, but do you have a lot of routes and stuff setup on your network? Your page table (?) could be exceptionally large created and issue on device lookup that appears to be DNS but is actually unrelated.

Also if you are doing things with IPSEC or VPN or IDS, then that just slows throughput down if there is not hardware offloading. Generic OoO CPUs are really bad at highly parallelized tasks.

“name resolution” can be configured in various ways in addition to DNS, e.g. mDNS is a thing where the computer asking would send a query to the local network multicast address and would wait for a reply…
… sometimes it could wait for all replies (basically until a predefined timeout).

All this depends on the software asking the libraries that come with the os to resolve the name, and then it depends upon the configuration of the particular os installed.

On Linux you can try running utilities behind strace to find out why things are taking their time. Browsers usually have a built in debugger with a recording mode that’ll tell you why your page is taking long to load.

2 Likes

like 5 static IP reservations and maybe 5 or 6 port forwarding rules. I am not familiar with a page table, dunno how to check that. I will try to google a bit about it

No VPN, and I dunno how to enable/disable IPSEC, and I don’t know what IDS is.

The Edgerouter X has some sort of specialized chip designed for certain networking tasks. Not sure if they are routing level things, or just switch level though. So there is some offloading that it does.

I definitely have a DNS server, recently set a pi-hole up. But for years before that, my router was configured to go to cloudflare and quad9 i think. Most of the NICs are just set to auto configure (win 10) so they should all be asking the router. Starting to feel like im imagining things lol

I assume you have both ipv4 and ipv6 set up and working?

I read something a while ago saying to disable ipv6, so it’s disabled.

If you are not using it or do not need the features, sure. But there is no real reason to turn it off unless it is causing an issue. The big reason for turning it off was that MS was late to the party and the plumbing for IPv6 was horrible until ~ Server 2016. I actually use IPv6 internally at my house.

You mean after logging in? Then it has nothing to do with dns…
The name is translated into ip once at the beginning, then it has no influence on what happens with the transmission and lag on the remote desktop.
The IP request takes place before you are able to enter your login / password.

So the problem might be somewhere else than in name / ip.

Slow domain name-to-IP resolution will generally cause an initial lag but only until the name is resolved and the machine gets the correct IP address from that point on, it will have no effect on lag. So if you have lag when transmitting data, the fault lies elsewhere, especially if we are talking about rdp.

2 Likes