You are not logged in.
Pages: 1
Topic closed
Hi,
I am trying to make DNS resolution in initramfs work.
I have added the net hook and curl and dig (via add_binary) to initramfs and ip=dhcp to the kernel command line. This is working perfectly: I get an IP, domain and DNS server. I can also ping the DNS server by its IP address.
However, running "curl https://www.google.de" bails out with error "could not resolve host". dig complains about some missing file (lib_dso or something).
So, network is up and running, DNS resolution is not. I have not been able to find any documentation regarding this.
Does anyone have a suggestion what else is needed to make DNS resolution work in initramfs?
Cheers, Ingo =;->
Last edited by Curly060 (2016-12-07 21:55:34)
Offline
Well, thanks to the Gentoo Wiki I found the solution:
Install hook:
add_file "/usr/lib/libnss_dns.so.2" "/usr/lib/libnss_dns.so.2" "$(stat -Lc %a /usr/lib/libnss_dns.so.2)"
add_file "/usr/lib/libnss_files.so.2" "/usr/lib/libnss_files.so.2" "$(stat -Lc %a /usr/lib/libnss_files.so.2)"
Hook:
Make sure to generate a valid /etc/resolv.conf from /tmp/net-*.conf
Maybe the net hook could be extended to support DNS resolution?
Offline
I love you @Curly060
In my case it was raspbian, and my hook line was:
copy_exec /usr/lib/arm-linux-gnueabihf/libnss_dns.so.2
I was going insane trying to understand why nslookup works, but not anything else like ping
Offline
Glad to hear, however please don't necro 5 year old threads.
Closing.
Offline
Pages: 1
Topic closed