What's new

Set static IP and hostname for hosts

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

tratek

Occasional Visitor
Hi,

Using LAN - DHCP-server I wanted to manually assign IP 192.168.x.x to printer device1 so that I can then ping it via hostname >> ping device1 instead of ping 192.168.x.x
How can I do that as adding "Host Name (Optional)" device1 does not work or I miss something?

Regards,
 
It should work. There's no "trick" to it. But your client does need to be using the router as it's DNS server and not some other server (like 8.8.8.8).
 
1) clients are using router's DNS
2) it doesnt work:
Ping2.jpg

3) any hints?
 
You don't need to hide private IP addresses (or MAC addresses) it just make things more difficult to diagnose.

Is this printer connected to main LAN's Wi-Fi or is it connected to a guest Wi-Fi network?

What output do you get from from nslookup drukarka_wifi ?
 
1) nslookup below (it finds the device by its name)
2) druarka (printer) does responde to ping via IP
Zrzut ekranu 2023-07-23 145035.png
 
This is appears to be a client side resolution issue. Try doing:
Code:
ping drukarka_wifi.
Include the "dot" at the end of the name.
 
nice! that worked ;-)
C:\Users\xx>ping drukarka_wifi.

Pinging drukarka_wifi [192.168.3.115] with 32 bytes of data:
Reply from 192.168.3.115: bytes=32 time=16ms TTL=255
Reply from 192.168.3.115: bytes=32 time=23ms TTL=255
Reply from 192.168.3.115: bytes=32 time=24ms TTL=255
Reply from 192.168.3.115: bytes=32 time=21ms TTL=255

Ping statistics for 192.168.3.115:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 16ms, Maximum = 24ms, Average = 21ms
 
nice! that worked ;-)
C:\Users\xx>ping drukarka_wifi.
The reason this worked is because you haven't defined a domain name for your LAN, so it's effectively null ("").

I suggest that you set your LAN's domain name on the router's LAN - DHCP Server page. Use something like home.lan (do not use local).

Reboot the router and see if you can now ping both drukarka_wifi (without the dot) and drukarka_wifi.home.lan
 
Thanks! It's working now in all combinations (1) device (2) device. (3) device.xx.lan

C:\Users\xx>ping drukarka_wifi.xx.lan

Pinging drukarka_wifi.xx.lan [192.168.3.115] with 32 bytes of data:
Reply from 192.168.3.115: bytes=32 time=38ms TTL=255
Reply from 192.168.3.115: bytes=32 time=5ms TTL=255
Reply from 192.168.3.115: bytes=32 time=8ms TTL=255
Reply from 192.168.3.115: bytes=32 time=15ms TTL=255

Ping statistics for 192.168.3.115:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 38ms, Average = 16ms

C:\Users\xx>ping drukarka_wifi.

Pinging drukarka_wifi [192.168.3.115] with 32 bytes of data:
Reply from 192.168.3.115: bytes=32 time=13ms TTL=255
Reply from 192.168.3.115: bytes=32 time=5ms TTL=255
Reply from 192.168.3.115: bytes=32 time=16ms TTL=255
Reply from 192.168.3.115: bytes=32 time=17ms TTL=255

Ping statistics for 192.168.3.115:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 17ms, Average = 12ms

C:\Users\xx>

C:\Users\xx>ping drukarka_wifi

Pinging drukarka_wifi.xx.lan [192.168.3.115] with 32 bytes of data:
Reply from 192.168.3.115: bytes=32 time=4ms TTL=255
Reply from 192.168.3.115: bytes=32 time=7ms TTL=255
Reply from 192.168.3.115: bytes=32 time=8ms TTL=255

Ping statistics for 192.168.3.115:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 8ms, Average = 6ms
Control-C


I will not set host names for all devices I need.

Your help is much appreciated ;-)
 
Similar threads
Thread starter Title Forum Replies Date
S Non-existent hostname Routers 1

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top