With `bsdsocket.library` providing a BSD-compatible API, standard network protocols can be implemented using familiar patterns adapted for the Amiga's single-address-space, library-based architecture.
---
## DNS Resolution
```c
/* gethostbyname — provided by bsdsocket.library: */
while ((n = recv(sock, buf + total, sizeof(buf) - total - 1, 0)) > 0)
total += n;
buf[total] = 0;
Printf("%s\n", buf);
CloseSocket(sock);
```
---
## DHCP Overview
DHCP on Amiga is typically handled by the TCP/IP stack itself (Roadshow, Miami) or an external client (AmiTCP + `dhclient`). The sequence is standard:
1.`DHCPDISCOVER` — broadcast on port 67
2.`DHCPOFFER` — server responds with IP offer
3.`DHCPREQUEST` — client accepts
4.`DHCPACK` — server confirms; lease begins
For MiSTer/FPGA cores with custom SANA-II drivers, DHCP is handled automatically once the SANA-II driver is online and the stack is configured for `IPTYPE=DHCP`.