Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV9: Add Internal DNS server #4220

Merged
merged 5 commits into from
Sep 26, 2021
Merged

Conversation

TheLastRar
Copy link
Contributor

@TheLastRar TheLastRar commented Feb 9, 2021

Using the CLR-DEV9 approach to resolve #4151

Depends on (and includes) #4301

This is a port of CLR-DEV9's DNS server, adapted to work with TAP and pcap (CLR-DEV9's was winsock only)

This PR adds an internal DNS server, that can be opted in by setting you DNS in the PS2 Network config to 192.0.2.1.
It features its own host list (DEV9Hosts.ini), allowing you to remap a url to a different IP address.
Note that while CLR-DEV9 used XML for its settings, this version uses PCSX2's iniInterface format for its host file.

If the internal DNS fails to find an url in its host list, is uses OS specific functions to look up the address.

The internal DNS will replace 127.0.0.1 with the PC's local IP (specifically the address assigned to the selected adapter), allowing PCSX2 to communicate with servers running on the same PC (i.e. developers of server revival projects may use this to allow developing on a single machine).

pcap may not fully work with 127.0.0.1 remapping, as it relies on your router to loop packets back to your PC.

Currently no UI is provided (as is the case with CLR-DEV9), and I'm not planning on providing one in this PR.

@TheLastRar TheLastRar force-pushed the DEV9-DNS branch 2 times, most recently from 4ec8c7f to 09e86a0 Compare February 9, 2021 12:03
@TheLastRar TheLastRar force-pushed the DEV9-DNS branch 2 times, most recently from 6188039 to 9e00f52 Compare February 13, 2021 20:43
@TheLastRar TheLastRar changed the title DEV9: Add Internal DNS server [WIP]DEV9: Add Internal DNS server Feb 18, 2021
@TheLastRar TheLastRar force-pushed the DEV9-DNS branch 4 times, most recently from c1ab94a to f9b1eeb Compare February 20, 2021 17:39
@TheLastRar TheLastRar changed the title [WIP]DEV9: Add Internal DNS server DEV9: Add Internal DNS server Feb 21, 2021
@refractionpcsx2 refractionpcsx2 added this to the Release 1.8 milestone Feb 26, 2021
@TheLastRar
Copy link
Contributor Author

Marking this as WIP again as I've noted that there are a few more things I want to change

pcsx2/DEV9/InternalServers/DNS_Logger.cpp Outdated Show resolved Hide resolved
pcsx2/DEV9/InternalServers/DNS_Logger.cpp Outdated Show resolved Hide resolved
pcsx2/DEV9/InternalServers/DNS_Server.cpp Outdated Show resolved Hide resolved
pcsx2/DEV9/InternalServers/DNS_Logger.h Outdated Show resolved Hide resolved
pcsx2/DEV9/InternalServers/DNS_Logger.cpp Outdated Show resolved Hide resolved
@Dnawrkshp
Copy link
Contributor

Hey this feature is extremely useful and I'd love to see this merged. Is there a timeline for when it will be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DEV9] ISPs that perform DNS hijacking can prevent games with resurrected servers from connecting
6 participants