How to make usable somedomain.lan instead static router ip?

Hello i know its possible,but maybe someone light me up how make somedomain name.lan for use instead static router ip 192.168.1.X ?i know how to ssh to router and know that this feature doing with dnsmasq :slight_smile: further mine knowledge ends,using OpenWrt 17.0.1 version

uci set system.@system[0].hostname="HOST_NAME"
uci commit system
service system restart

uci set dhcp.@dnsmasq[0].domain="DOMAIN_NAME"
uci commit dhcp
service dnsmasq restart
2 Likes

not this :slight_smile: it was something with connecting via ssh to router and editing hosts file :thinking:

https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#static_leases

not this :smiley:

Please, explain what do you want to achieve, using that domain name.

okay situation to get in router i must use static 192.168.1.11 adress,so what i wanna this ip point to domain.lan :smiley: some sort like 192.168.1.x convert to local domain.

The general convention is hostname.lan

So if the hostname/system-name of your router is openwrt the default then you would use
openwrt.lan

You just need to know the hostname

1 Like

look from 8second to 45s.https://www.youtube.com/watch?v=3GgRKuVaH5o and maybe you may understand what i wanna to do :slight_smile:

In a totally default setup, from a computer connected to the LAN you can access the router as http://openwrt.lan. or ssh root@openwrt.lan.

If that does not work, the question is what did you change to break it?

3 Likes

I believe @vgaetera has solved your issue already with the post above. You on the other hand, I think, dont know the config files much. So I'll just explain this here. In the video the person was using the address (just for example sake) something.lede, so the something part is from Hostname of the router which is openwrt as a default and lede part is from DHCP config, the domain part. So if you want something like above just do this:

uci set system.@system[0].hostname="something"
uci commit system
service system restart

uci set dhcp.@dnsmasq[0].domain="lede"
uci commit dhcp
service dnsmasq restart

This should change the router url to something.lede and you can then access it like this: http://something.lede or ssh root@something.lede.

where make these commands?after log in router via ssh?and if i wanna use not one domain? :slight_smile: these teams will "tied" up router static ip with something.lede?

2 Likes

hostnames changed and nothing more,still to get into router i must write ip :slight_smile:

Verify, the changes are applied correctly:

uci get system.@system[0].hostname
uci get dhcp.@dnsmasq[0].domain

Verify, your client has no other DNS-providers, than IPv4/IPv6-address of your router.

1 Like

Your PC must be using the router as its DNS server. since it is the only server that can know your local names. This is normally the case with a default configuration where IP is assigned to the PC by DHCP from the router.

dns are set to use only cloudflare in main router,because this is operating like wifi ap but in same subnet as main.

And how did you set the clients?

1 Like

Looks easy thing,but not easy for to do :smiley:
root@asus:~# uci get system.@system[0].hostname
asus
root@asus:~# uci get dhcp.@dnsmasq[0].domain
lan
me sure that good thing? :slight_smile:

The problem here is that your PC is configured to bypass any local DNS system and go directly to a public DNS. It cannot look up local names.

That can be worked around-- if you have a main router able to serve local DNS you can either enter the AP's name / static IP as a DNS record, use a DHCP reservation, or let the AP DHCP an address from the main router and register its hostname to the local DNS.

2 Likes