Vb.net Get Local Pc Name Without Dns

0919
Vb.net Get Local Pc Name Without Dns 4,9/5 9855 votes
  1. Vb.net Get Local Pc Name Without Dns Code

HiI look after a few small networks, where there is a small router, a number of PCs, and NO windows domain, NO WINS and NO DNS server for internal names - DNS resolves to external names only.Two companies are now getting issues they've never had before.Simply - one program cannot correctly resolve a hostname to IP address. On one site its Sage; on the other site its PDQ Inventory. The symptoms are the same.PC1 can 'ping' address of PC2 and it resolves to IPv4 address correctle.PC1 can map drive to quite happilyOn site 1, PC1 connects to Sage on PC2 via - worked fine for 3+ years, and 1.5y+ on Windows 10, but stopped a few months ago. Sage said 'ah - its a windows update' and then amended company file to the IP address of PC2. (However, adding the IP and hostname to local hosts, and Sage also works)On site 2, PC1 runs PDQ inventory, and you can ping every PC on the network by name and access UNC shares by name.

Vb.net Get Local Pc Name Without Dns Code

But, PDQ inventory says unable to resolve hostname. Adding hostname/IP to hosts file, and hey presto it all works fine.Now the PCs.CAN. resolve names for both 'ping' and UNC shares - and this has always been the case.

Retrieve the Machine Name from IP address Home. Programming Forum. I found this article 'How Can I Determine the Name of the Local Computer Using WMI?' Which may be a good starting point. I have tried that, but all it returns is the DNS host name, not the actual machine name, thanks though. How to get ip address in vb.net. I used below code to get local ip address but it showing dns is not declared. Can any one tell me what is that Dns in the Code VB Code Imports System.Environment. To get the hostname/computer name, you can use the GetHostEntry method of Dns class in System.Net namespace. The GetHostEntry will accept the ipaddress will resolve it to a host name by querying the DNS server. The below little code snippet will help us to get the ip address and name of the client who is accessing our asp.net site.

But its as if a recent update has changed something so that certain applications that resolve names a different way no longer work? Its as if some things are now going direct to the hosts file then DNS server for name resolution, and not using NETBIOS for LAN name lookup.No site has ever had a DNS server - except for resolving web addresses.I don't want to maintain local hosts files, and these sites don't have anything capable of running a robust DNS server for the LAN.Both sites are workgroup, and PC domain suffixes are not set.What am I missing?:)Thanks. Just to add.In PDQ, if I remove PC2 and re-add it, the initial screen 'ticks' the host-name - and thus proves it resolves it ok. But then fails to heart-beat or scan.Firewall on 'remote' PCs is fine and 'open' (or off for tests) - connectivity is fine, Managing with PDQ Inventory - tools-RDP and Event Viewer is OK, but tools-manage with MMC does not work.(once adding hostname/IP to local hosts - all starts working.

Vb.net get local pc name without dns server

And running compmgmt.msc and then connecting to the remote computer manually by name works fine. So I don't think its a 'remote' issue at all)nbtstat -r correctly shows hosts resolving as broadcast.Totally bemused as to why its stopped. The PCs do use the internal router for DNS and DHCP, but the router does not resolve internal names - so using NSLOOKUP does not return the name.IPs will of course work - but that's not the question.Both sites can ping names, and map drives by name, and do everything by name (e.g. MMC remote connections) and its fine. NetBIOS name resolution is fineBut, recently on both sites an application has stopped being able to resolve by name - as if whatever method they use has been changed to hosts then DNS, rather than hosts, NetBIOS then DNS.Hope that clarifies?Happy to clarify any other questions.

These sites are small, have no servers, just a few PCs and router. A third site I also look after, also been running PDQ for 12mth+ - on a PC, in exactly the same setup as the site above. No DNS, Domain, Wins, and the router doe snot resolve internal names.This works 100% fine - even today. (As did the other). The only difference, is on the working site, the PC running PDQ is w10 v1709 and the one that stopped working is on w10 v1803. It was working on 1709.

(I can't say 100% the 1803 upgrade broke it - but it was there or there abouts)The site where Sage broke was after the 1803 update, and Sage support are aware the Windows update breaks it and they modified company file to IP rather than name (despite name working from command prompt).So something changes, probably on 1803, that affects name resolution that worked before (for many years). On a network of, PCs only - where do you put a robust DNS server? Can't use a user-side PC as they get turned off, rebooted and used. Even if you did - what DNS server would you use as DNS is server-only on Windows isn't it?PDQ inventory as an application is fully supported to run on Windows 10. It connects to remote machines to scan/inventory.

As designed.Sage is fully supported to run on Windows 10, and to run on a PC, and to share the data out from that PC to other PCs.Not all companies have servers around to run DNS - and when things have been working for years, justifying a server just for name resolution which had been working fine is a tough sell. =The routers DNS (AFAIK, but will RTFM) does support client registration or integrate with DHCP (one is a Ubiquity Edge, and one is a Draytek 2860, and one is some. Virgin router with little option).If there are simple solutions for small companies - happy to hear it!(Fortunately the issues today can be fixed with local hosts for Sage (as fixed IP on main PC anyway); and the PDQ issue affects me only; and the working site would affect PDQ only and I've blocked the update). I'm asking because this will come up again and may have a bigger impact that needs fixing.Enabling the Windows services etc as above post doesn't seem to work. Yes, it fixes browsing and machines appear in explorer, but PDQ still doesn't resolve the hostname consistently. Very strange. Mr Marmite wrote:On a network of, PCs only - where do you put a robust DNS server?

Vb.net get local pc name without dns search

Can't use a user-side PC as they get turned off, rebooted and used. Even if you did - what DNS server would you use as DNS is server-only on Windows isn't it?Who said it had to be a windows server?So you are a UK user and/or your business are too - a Virgin router, assuming you dont cheap out and get residential to run in a business should handle DHCP and DNS just fine, but if you are using consumer grade kit and a residential line - what do you expect?Your simplest, solution (and I'll use that term loosely) is static IPs per machine and host files. The customers in question (2 working, 1 not), 2 are on business leased line, one with Draytek 2860 and one with Edgerouter - both 'small business class' - one is Virgin business fibre with their provided (awful) router. Not consumer kit, but kit suitable to the business type and size. All been working well for 12mths each.All devices do provide DNS and DHCP and do that fine (amongst other things).

But none resolve internal hostnames via the DNS server. None of the DNS servers allow client registration.

(. that I am aware of - I've not explored this avenue in detail, but will - if the router DNS can either integrate with its own DHCP or allows registration - then great. I need to RTFM as the hint above that the Edgerouter can work is good - but that's on the working site lol - but will be good to get working that way anyway). I've not researched this as an option yet - I will.Hosts files - yes will work - but to answer 'I dont see the difference between this and the fact you relied on and used old technologies already.' In each of the 3x cases, they are single LAN and all clients on same network.The multi-site comment was referring to elsewhere where they've had lots of server infrastructure.So I'd say my experience of DNS in a windows server environment is quite good, up to 1000s of users across 10s of sites.I'd say my experience of name resolution outside of windows server environments (eg the 3x customers mentioned here) is quite minimal - as its always just worked and never needed anything before.

You are right, things always change. I don't usually get caught with my trousers down waiting to be shafted, but appear to unprepared this time. And I'm short of a simple answer - and the answer will be new to me. (Yes, I can stick in a Windows server lol - but that's not going to happen). I don't think all 3 routers will support DNS/DHCP integration or dynamic registration.

Vb.net get local pc name without dns server

So local hosts (yuk) will work, but am hoping for a better solution for name resolution that is suitable for the smaller companies. That's where I have a knowledge gapThanks for the chat:).

This entry was posted on 19.09.2019.