imx6Q Change hostname and domain name

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx6Q Change hostname and domain name

971 次查看
AlexBen
Contributor I

Hi,
I use imx6quad processor.

I need to change hostname and domain name.

The device connects to the network via DHCP and I installed:
- dhcpcd
- avahi-daemon

I modificed the /etc/hostname file to change my hostname (eg. test).
In the /etc/resolv.conf file the DHCP places "domain mydomain"
and in the /etc/host I write "ip_address test.mydomain test"


The command "ping test.mydomain" doesn't work but "ping test.mydomain" it's work.


How can reached the device with test.mydomain?

Thanks
Alessandro
0 项奖励
回复
1 回复

967 次查看
b36401
NXP Employee
NXP Employee

You can use "search" option of resolv.conf file for the system to lookup hosts in the domain:
root@imx8mqevk:~# echo search domain.com >> /etc/resolv.conf

Also please note that if will take effect for hosts of this domain (like host.domain.com) not for domain name itself.
I mean adding domain.com info resolv.conf file allows to type "host" instead of "host.domain.com".

And also please pay attention to /etc/hosts file. You can add some high-usage names there.

0 项奖励
回复